Repository navigation
61 lines (55 loc) · 1.84 KB
/
Copy pathdeploy.yml
File metadata and controls
61 lines (55 loc) · 1.84 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
name: Deploy site to GitHub Pages
# Builds the site with site/build.sh (MathStruct's shared Quartz, https://github.com/MathStruct/quartz)
# and deploys it on every push to master. A pull request is built too, without deploying: the
# rendered site is attached to the run as the "site" artifact, so a change can be looked at
# before it is merged (download, unzip, `npx serve <folder>`).
on:
push:
branches: [master]
pull_request:
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages-${{ github.event_name == 'pull_request' && github.ref || 'deploy' }}
cancel-in-progress: ${{ github.event_name == 'pull_request' }}
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0 # git history is used for created/modified dates
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Build site with Quartz
run: site/build.sh
- name: Attach the rendered site to a pull request's run
if: github.event_name == 'pull_request'
uses: actions/upload-artifact@v4
with:
name: site
path: site/public
retention-days: 14
- name: Configure GitHub Pages
if: github.event_name != 'pull_request'
uses: actions/configure-pages@v5
with:
enablement: true # enable Pages (source: GitHub Actions) if it is not enabled yet
- if: github.event_name != 'pull_request'
uses: actions/upload-pages-artifact@v3
with:
path: site/public
deploy:
if: github.event_name != 'pull_request'
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- id: deployment
uses: actions/deploy-pages@v4