|
| 1 | +# GitHub Pages Setup Guide |
| 2 | + |
| 3 | +This repository is configured to automatically deploy to GitHub Pages using GitHub Actions. |
| 4 | + |
| 5 | +## Automatic Deployment |
| 6 | + |
| 7 | +The site will automatically build and deploy when you push to the `main`, `master`, or `bookdown` branch. |
| 8 | + |
| 9 | +### Setup Steps: |
| 10 | + |
| 11 | +1. **Enable GitHub Pages in your repository:** |
| 12 | + - Go to your repository on GitHub |
| 13 | + - Click on **Settings** → **Pages** |
| 14 | + - Under "Source", select **GitHub Actions** (not "Deploy from a branch") |
| 15 | + - Save the settings |
| 16 | + |
| 17 | +2. **Push your changes:** |
| 18 | + - The GitHub Actions workflow (`.github/workflows/deploy-pages.yml`) will automatically: |
| 19 | + - Build the site using the `build_site.py` script |
| 20 | + - Deploy it to GitHub Pages |
| 21 | + - Your site will be available at: `https://[your-username].github.io/RNA-seq-Differential-Expression-workshop-June-2022/` |
| 22 | + |
| 23 | +## Manual Deployment (Alternative) |
| 24 | + |
| 25 | +If you prefer to deploy manually: |
| 26 | + |
| 27 | +1. Build the site locally: |
| 28 | + ```bash |
| 29 | + python3 build_site.py |
| 30 | + ``` |
| 31 | + |
| 32 | +2. Push the `docs/` directory to the `gh-pages` branch: |
| 33 | + ```bash |
| 34 | + git subtree push --prefix docs origin gh-pages |
| 35 | + ``` |
| 36 | + |
| 37 | + Or if the `gh-pages` branch doesn't exist: |
| 38 | + ```bash |
| 39 | + git checkout --orphan gh-pages |
| 40 | + git rm -rf . |
| 41 | + cp -r docs/* . |
| 42 | + git add . |
| 43 | + git commit -m "Deploy site" |
| 44 | + git push origin gh-pages |
| 45 | + ``` |
| 46 | + |
| 47 | +3. Configure GitHub Pages to use the `gh-pages` branch as the source. |
| 48 | + |
| 49 | +## Custom Domain (Optional) |
| 50 | + |
| 51 | +If you want to use a custom domain: |
| 52 | + |
| 53 | +1. Create a `CNAME` file in the `docs/` directory with your domain name |
| 54 | +2. Update your DNS settings to point to GitHub Pages |
| 55 | +3. The workflow will automatically include the CNAME file in deployments |
| 56 | + |
| 57 | +## Troubleshooting |
| 58 | + |
| 59 | +- **Images not showing:** Make sure all image paths in markdown files use `../figures/` or `figures/` (the build script normalizes these) |
| 60 | +- **Build fails:** Check that Python 3.9+ is available and the `markdown` package is installed |
| 61 | +- **Pages not updating:** Wait a few minutes after pushing, GitHub Pages can take 1-2 minutes to update |
| 62 | + |
0 commit comments