Skip to content

Commit 859bcec

Browse files
committed
Update a bunch of things in the GitHub actions
1 parent 547ca4f commit 859bcec

File tree

2 files changed

+16
-22
lines changed

2 files changed

+16
-22
lines changed

.github/workflows/build-and-deploy.yml

Lines changed: 15 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
1+
# Responsible for building and deploying the static pages that make up
2+
# the website.
13
name: Build and Deploy Site
24

35
# Controls when the action will run.
@@ -9,45 +11,34 @@ on:
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
1314
jobs:
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

asset-generator/.nvmrc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
24.13.0

0 commit comments

Comments
 (0)