|
| 1 | +#!/bin/bash |
| 2 | + |
| 3 | +# Script to help configure GitHub Pages settings |
| 4 | + |
| 5 | +# Colors for output |
| 6 | +GREEN='\033[0;32m' |
| 7 | +YELLOW='\033[1;33m' |
| 8 | +RED='\033[0;31m' |
| 9 | +NC='\033[0m' # No Color |
| 10 | + |
| 11 | +echo -e "${YELLOW}GitHub Pages Configuration Helper${NC}" |
| 12 | +echo -e "${YELLOW}=================================${NC}\n" |
| 13 | + |
| 14 | +echo -e "${YELLOW}This script will help you configure GitHub Pages to deploy your site to the root URL.${NC}" |
| 15 | +echo -e "${YELLOW}Please follow these steps:${NC}\n" |
| 16 | + |
| 17 | +echo -e "1. ${GREEN}Go to your GitHub repository:${NC}" |
| 18 | +echo -e " https://github.com/ipcrypt-std/www/settings/pages\n" |
| 19 | + |
| 20 | +echo -e "2. ${GREEN}Under 'Build and deployment' section:${NC}" |
| 21 | +echo -e " - Source: ${YELLOW}GitHub Actions${NC}" |
| 22 | +echo -e " (This should already be selected)\n" |
| 23 | + |
| 24 | +echo -e "3. ${GREEN}Under 'Custom domain' section:${NC}" |
| 25 | +echo -e " - Make sure this is empty (unless you want to use a custom domain)\n" |
| 26 | + |
| 27 | +echo -e "4. ${GREEN}Check your repository name:${NC}" |
| 28 | +echo -e " - If your repository is named 'ipcrypt-std.github.io', your site will be published at:" |
| 29 | +echo -e " ${YELLOW}https://ipcrypt-std.github.io/${NC}" |
| 30 | +echo -e " - If your repository is named 'www', your site will be published at:" |
| 31 | +echo -e " ${YELLOW}https://ipcrypt-std.github.io/www/${NC}" |
| 32 | +echo -e " - To publish at the root URL with a repository named 'www', you need to:" |
| 33 | +echo -e " a. Create a new repository named 'ipcrypt-std.github.io'" |
| 34 | +echo -e " b. Push your code to that repository" |
| 35 | +echo -e " c. Configure GitHub Pages as described above\n" |
| 36 | + |
| 37 | +echo -e "5. ${GREEN}Alternative approach - Create a gh-pages branch:${NC}" |
| 38 | +echo -e " If you want to keep your repository name as 'www' but deploy to the root URL," |
| 39 | +echo -e " you can create a gh-pages branch with a special structure:" |
| 40 | +echo -e " $()$(bash" |
| 41 | +echo -e " git checkout --orphan gh-pages" |
| 42 | +echo -e " git rm -rf ." |
| 43 | +echo -e " echo '<meta http-equiv=\"refresh\" content=\"0;url=https://ipcrypt-std.github.io/www/\">' \ |
| 44 | + git add index.html" |
| 45 | +echo -e " git commit -m \"Add redirect to www subdirectory\"" |
| 46 | +echo -e " git push origin gh-pages" |
| 47 | +echo -e " >index.html" |
| 48 | +echo -e ")$()" |
| 49 | +echo -e " Then in GitHub repository settings, set the source to 'Deploy from a branch'" |
| 50 | +echo -e " and select the 'gh-pages' branch.\n" |
| 51 | + |
| 52 | +echo -e "${YELLOW}After making these changes, your site should be deployed to the root URL.${NC}" |
| 53 | +echo -e "${YELLOW}It may take a few minutes for the changes to take effect.${NC}\n" |
| 54 | + |
| 55 | +echo -e "${GREEN}Done!${NC}" |
0 commit comments