1- # Simple workflow for deploying static content to GitHub Pages
21name : Deploy static content to Pages
32
43on :
5- # Runs on pushes targeting the default branch
64 push :
75 branches : ["master"]
86
9- # Allows you to run this workflow manually from the Actions tab
107 workflow_dispatch :
118
12- # Sets permissions of the GITHUB_TOKEN to allow deployment to GitHub Pages
139permissions :
1410 contents : read
1511 pages : write
1612 id-token : write
1713
18- # Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued.
19- # However, do NOT cancel in-progress runs as we want to allow these production deployments to complete.
2014concurrency :
2115 group : " pages"
2216 cancel-in-progress : false
2317
2418jobs :
25- # Single deploy job since we're just deploying
2619 deploy :
2720 environment :
2821 name : github-pages
2922 url : ${{ steps.deployment.outputs.page_url }}
23+
3024 runs-on : ubuntu-latest
25+
3126 steps :
32- - name : Checkout
27+ - name : Checkout current site (master)
28+ uses : actions/checkout@v4
29+ with :
30+ ref : master
31+ path : current
32+ submodules : false
33+
34+ - name : Checkout old site (old branch)
3335 uses : actions/checkout@v4
3436 with :
37+ ref : old
38+ path : oldsite
3539 submodules : false
36- - name : Initialize public submodules only
40+
41+ - name : Initialize submodules for current site
42+ working-directory : current
3743 run : |
3844 git submodule sync
3945 git submodule update --init Applications/FrostedColours
4046 git submodule update --init Applications/StereogramMaker
4147 git submodule update --init Applications/Cube/WebGraphics
4248 git submodule update --init Applications/Level/WebGraphics
43- git submodule update --init Applications/Level/WebGraphics
4449 git submodule update --init Applications/Cyanide
50+
51+ - name : Build Pages folder
52+ run : |
53+ mkdir public
54+
55+ # Copy current site to root
56+ cp -r current/* public/
57+
58+ # Copy old site into /old
59+ mkdir -p public/old
60+ cp -r oldsite/* public/old/
61+
4562 - name : Setup Pages
4663 uses : actions/configure-pages@v5
64+
4765 - name : Upload artifact
4866 uses : actions/upload-pages-artifact@v3
4967 with :
50- # Upload entire repository
51- path : ' . '
68+ path : public
69+
5270 - name : Deploy to GitHub Pages
5371 id : deployment
54- uses : actions/deploy-pages@v4
72+ uses : actions/deploy-pages@v4
0 commit comments