1+ # Responsible for building and deploying the static pages that make up
2+ # the website.
13name : Build and Deploy Site
24
35# Controls when the action will run.
911 # Allows you to run this workflow manually from the Actions tab
1012 workflow_dispatch :
1113
12- # A workflow run is made up of one or more jobs that can run sequentially or in parallel
1314jobs :
14- # This workflow contains one job called "build" and one called "deploy"
1515 build :
1616 # The type of runner that the job will run on
1717 runs-on : ubuntu-latest
1818
1919 # Steps represent a sequence of tasks that will be executed as part of the job
2020 steps :
2121 # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
22- - uses : actions/checkout@v4
22+ - uses : actions/checkout@v6
23+
24+ - name : Install just
25+ run : sudo apt install just
2326
2427 # Set up Node
2528 - name : Set up Node
26- uses : actions/setup-node@v4
29+ uses : actions/setup-node@v6
2730 with :
28- node-version : 20
31+ node-version-file : asset-generator/.nvmrc
2932
3033 - name : Install Node packages
3134 run : |
3235 cd asset-generator && npm ci
3336
34- - name : Clear asset directory
35- run : |
36- rm -Rf content/images
37- rm -Rf content/js
37+ - name : Run tests
38+ run : just test
3839
39- - name : Generate dynamic assets
40- run : |
41- cd asset-generator
42- rm -Rf dist web-bundles
43- tsc
44- node dist/index.js
45- webpack --mode production
46-
47- - name : Copy dynamic assets into the site directory
48- run : |
49- cp -r asset-generator/static/. content/images
50- cp -r asset-generator/web-bundles/. content/js
40+ - name : Generate assets
41+ run : just assets
5142
5243 # Set up Python
5344 - name : Set up Python
@@ -69,14 +60,16 @@ jobs:
6960 uses : actions/configure-pages@v5
7061
7162 - name : Upload Artifact
72- uses : actions/upload-pages-artifact@v3
63+ uses : actions/upload-pages-artifact@v4
7364 with :
7465 # upload just the output folder
7566 path : ' ./output'
7667
7768 # The deploy job
7869 deploy :
7970 runs-on : ubuntu-latest
71+ # Only deploy if this commit was to master
72+ if : ${{ github.ref == 'refs/heads/master' }}
8073 needs : build
8174 permissions :
8275 pages : write
0 commit comments