Skip to content

Commit c914730

Browse files
bookdown
1 parent 18e024e commit c914730

92 files changed

Lines changed: 4561 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/workflows/deploy-pages.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy to GitHub Pages
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
- master
8+
- bookdown
9+
workflow_dispatch:
10+
11+
permissions:
12+
contents: read
13+
pages: write
14+
id-token: write
15+
16+
concurrency:
17+
group: "pages"
18+
cancel-in-progress: false
19+
20+
jobs:
21+
build:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v4
26+
27+
- name: Set up Python
28+
uses: actions/setup-python@v5
29+
with:
30+
python-version: '3.9'
31+
32+
- name: Install dependencies
33+
run: |
34+
python3 -m pip install --upgrade pip
35+
pip install markdown
36+
37+
- name: Build site
38+
run: |
39+
python3 build_site.py
40+
41+
- name: Setup Pages
42+
uses: actions/configure-pages@v4
43+
44+
- name: Upload artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: './docs'
48+
49+
deploy:
50+
environment:
51+
name: github-pages
52+
url: ${{ steps.deployment.outputs.page_url }}
53+
runs-on: ubuntu-latest
54+
needs: build
55+
steps:
56+
- name: Deploy to GitHub Pages
57+
id: deployment
58+
uses: actions/deploy-pages@v4
59+

GITHUB_PAGES_SETUP.md

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
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

Comments
 (0)