Repository navigation
79 lines (70 loc) · 1.97 KB
/
Copy pathdeploy-website.yml
File metadata and controls
79 lines (70 loc) · 1.97 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
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
name: Deploy Website
on:
push:
branches:
- main
- next
- "v*"
paths-ignore:
- ".github/**"
- ".vscode/**"
# workflow_dispatch means to manual deploy production
workflow_dispatch:
# workflow_call means to deploy production from external workflow
# it would be useful to trigger from fastify main repo instead of
# daily schedule
workflow_call:
permissions:
contents: read
jobs:
build-and-upload:
runs-on: ubuntu-latest
permissions:
contents: read
env:
BASE_URL: "/"
steps:
- name: Checkout
uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1
with:
persist-credentials: false
- name: Use Node.js
uses: actions/setup-node@949feb2413d6458794dcd2491c4babbbce0c15c1 # v7.1.0
with:
cache: npm
check-latest: true
node-version-file: ".nvmrc"
- name: Install Packages
run: npm ci --ignore-scripts
- name: Setup Pages
uses: actions/configure-pages@45bfe0192ca1faeb007ade9deae92b16b8254a0d # v6.0.0
- name: Build website
run: npm run build:website
timeout-minutes: 30
env:
GH_TOKEN: ${{ github.token }}
- name: Upload artifact
uses: actions/upload-pages-artifact@fc324d3547104276b827a68afc52ff2a11cc49c9 # v5.0.0
with:
path: "./build"
deploy-to-production:
needs:
- build-and-upload
concurrency:
group: ${{ github.ref_name }}-production
cancel-in-progress: true
env:
BASE_URL: ""
permissions:
pages: write
id-token: write
environment:
name: production
url: ${{ steps.deployment.outputs.page_url }}
outputs:
deployment_url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@368f82528645a54fb793d4d04e342629a3f51346 # v5.0.1