Skip to content

Commit dc397af

Browse files
authored
Merge pull request #9 from doingmathwithpython/copilot/update-website-publishing
Switch Pelican publishing to GitHub Pages Actions workflow
2 parents 076e1c3 + 6db2018 commit dc397af

2 files changed

Lines changed: 62 additions & 6 deletions

File tree

‎.github/workflows/publish.yml‎

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
name: Publish website
2+
3+
on:
4+
push:
5+
branches:
6+
- master
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pages: write
12+
id-token: write
13+
14+
concurrency:
15+
group: pages
16+
cancel-in-progress: true
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Check out repository
23+
uses: actions/checkout@v4
24+
25+
- name: Set up Python
26+
uses: actions/setup-python@v5
27+
with:
28+
python-version: "3.x"
29+
30+
- name: Install Pelican and plugins
31+
run: |
32+
python -m pip install --upgrade pip
33+
python -m pip install pelican pelican-youtube markdown pelican-gist beautifulsoup4
34+
git clone --recursive https://github.com/getpelican/pelican-plugins /pelican-plugins
35+
36+
- name: Build site
37+
run: |
38+
make build
39+
cp CNAME output/CNAME
40+
41+
- name: Configure Pages
42+
uses: actions/configure-pages@v5
43+
44+
- name: Upload Pages artifact
45+
uses: actions/upload-pages-artifact@v3
46+
with:
47+
path: output
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

‎README.md‎

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,7 @@
11
# Notes for future self
22

3+
Publishing is handled by GitHub Actions.
34

4-
1. Edit on site
5-
2. build using ./build.sh
6-
3. copy output somewhere
7-
4. git checkout master
8-
5. copy the output from somewhere to master
9-
6. git push
5+
1. Edit content on the `master` branch
6+
2. Push changes
7+
3. GitHub Actions builds the Pelican site and deploys to GitHub Pages

0 commit comments

Comments
 (0)