@@ -3,60 +3,63 @@ name: Build and Deploy to GitHub Pages
33on :
44 push :
55 branches :
6- - main # Deploy when pushing to new-website branch
7- workflow_dispatch : # Allow manual triggering from GitHub UI
6+ - main
7+ workflow_dispatch :
88
9- jobs :
10- build-and-deploy :
11- runs-on : ubuntu-latest
9+ permissions :
10+ contents : read
11+ pages : write
12+ id-token : write
1213
13- permissions :
14- contents : write # Required for pushing to the repository
14+ concurrency :
15+ group : " pages"
16+ cancel-in-progress : true
1517
18+ jobs :
19+ build :
20+ runs-on : ubuntu-latest
1621 steps :
1722 - name : Checkout repository
1823 uses : actions/checkout@v4
19- with :
20- fetch-depth : 0 # Fetch all history for proper git operations
2124
2225 - name : Setup Node.js
2326 uses : actions/setup-node@v4
2427 with :
25- node-version : ' 18 '
26- cache : ' npm'
28+ node-version : " 18 "
29+ cache : " npm"
2730
2831 - name : Install dependencies
2932 run : npm ci
3033
3134 - name : Build static site
3235 run : npm run build
3336
34- - name : Prepare GitHub Pages deployment
37+ - name : Copy recordings assets
3538 run : |
36- # Remove existing docs directory if it exists
37- rm -rf docs
38-
39- # Copy build output to docs directory
40- cp -r build docs
41-
42- # Create .nojekyll file to bypass Jekyll processing
43- touch docs/.nojekyll
44-
45- - name : Configure Git
46- run : |
47- git config --local user.email "github-actions[bot]@users.noreply.github.com"
48- git config --local user.name "github-actions[bot]"
39+ if [ -d src/data/recordings ]; then
40+ mkdir -p build/recordings
41+ cp -R src/data/recordings/. build/recordings/
42+ fi
4943
50- - name : Commit and push changes
44+ - name : Prepare Pages artifact
5145 run : |
52- git add docs
53-
54- # Only commit if there are changes
55- if git diff --staged --quiet; then
56- echo "No changes to commit"
57- else
58- git commit -m "update github pages"
59- git push
46+ touch build/.nojekyll
47+ if [ -f build/200.html ]; then
48+ cp build/200.html build/404.html
6049 fi
61- env :
62- GITHUB_TOKEN : ${{ secrets.GITHUB_TOKEN }}
50+
51+ - name : Upload artifact
52+ uses : actions/upload-pages-artifact@v3
53+ with :
54+ path : build
55+
56+ deploy :
57+ needs : build
58+ runs-on : ubuntu-latest
59+ environment :
60+ name : github-pages
61+ url : ${{ steps.deployment.outputs.page_url }}
62+ steps :
63+ - name : Deploy to GitHub Pages
64+ id : deployment
65+ uses : actions/deploy-pages@v4
0 commit comments