File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1+ name : Publish to GitHub Pages
2+
3+ # Publishes the committed html/ folder to GitHub Pages.
4+ # The html/ folder is committed (it is not gitignored); regenerate it locally
5+ # by running `python main.py` whenever the source exhibition changes.
6+
7+ on :
8+ push :
9+ branches : [main]
10+ paths :
11+ - ' html/**'
12+ - ' .github/workflows/pages.yml'
13+ workflow_dispatch :
14+
15+ permissions :
16+ contents : read
17+
18+ concurrency :
19+ group : pages
20+ cancel-in-progress : true
21+
22+ jobs :
23+ build :
24+ runs-on : ubuntu-latest
25+ steps :
26+ - uses : actions/checkout@v4
27+
28+ - name : Verify html/ exists
29+ run : test -f html/index.html
30+
31+ - uses : actions/configure-pages@v5
32+
33+ - uses : actions/upload-pages-artifact@v3
34+ with :
35+ path : html
36+
37+ deploy :
38+ needs : build
39+ runs-on : ubuntu-latest
40+ environment :
41+ name : github-pages
42+ url : ${{ steps.deploy.outputs.page_url }}
43+ permissions :
44+ pages : write
45+ id-token : write
46+ steps :
47+ - id : deploy
48+ uses : actions/deploy-pages@v4
Original file line number Diff line number Diff line change 2121
2222# Output of the tool
2323output /
24- html /
Original file line number Diff line number Diff line change @@ -38,6 +38,29 @@ With no arguments it mirrors the SHARC exhibition into `./html/`.
3838 URL so they still load when online. Re-run from an unrestricted network to
3939 fill them in.
4040
41+ ## Publishing to GitHub Pages
42+
43+ The ` html/ ` folder is committed to the repo (it is the published artifact).
44+ A workflow at ` .github/workflows/pages.yml ` publishes it to GitHub Pages
45+ whenever ` html/** ` changes on ` main ` :
46+
47+ - In the repo ** Settings → Pages → Build and deployment → Source** , select
48+ ** GitHub Actions** .
49+ - Push (or merge) a change under ` html/ ` to ` main ` . The workflow uploads the
50+ ` html/ ` folder as a Pages artifact and deploys it. You can also run it
51+ manually via the Actions tab (** workflow_dispatch** ).
52+
53+ To refresh the published mirror, regenerate it locally and commit the
54+ updated ` html/ ` folder:
55+
56+ ``` bash
57+ pip install -r requirements.txt
58+ python main.py
59+ git add html
60+ git commit -m " docs: refresh html mirror"
61+ git push
62+ ```
63+
4164## License
4265
4366MIT
You can’t perform that action at this time.
0 commit comments