Repository navigation
63 lines (59 loc) · 1.81 KB
/
Copy pathdeploy.yml
File metadata and controls
63 lines (59 loc) · 1.81 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
name: Deploy
on:
push:
branches: [main]
# Build PRs too, so dependency updates are checked before they reach main.
pull_request:
workflow_dispatch:
permissions:
contents: read
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
pages: read
steps:
- uses: actions/checkout@v7
- uses: actions/setup-node@v7
with:
node-version-file: .tool-versions
cache: npm
- run: npm ci
# public/ serves copies of the fonts' licenses; fail if a font update changes them.
- run: |
cmp node_modules/@fontsource/nunito/LICENSE public/fonts/nunito-OFL.txt
cmp node_modules/@fontsource/zen-maru-gothic/LICENSE public/fonts/zen-maru-gothic-OFL.txt
- run: npm run check
- run: npm test
- run: npm run build
# Links and canonical URLs end with a slash (/making/), but Void writes
# making.html, and GitHub Pages answers /making/ with a 404 unless
# making/index.html exists.
- run: |
find dist/client -name '*.html' ! -name index.html ! -name 404.html | while read -r file; do
mkdir -p "${file%.html}"
mv "$file" "${file%.html}/index.html"
done
- if: github.event_name != 'pull_request'
uses: actions/configure-pages@v6
- if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v5
with:
path: dist/client
deploy:
if: github.event_name != 'pull_request'
needs: build
runs-on: ubuntu-latest
permissions:
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- id: deployment
uses: actions/deploy-pages@v5