-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (45 loc) · 1.24 KB
/
deploy-static-site.yaml
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
name: Deploy static site
on:
push:
branches:
- main
workflow_dispatch:
concurrency:
group: "github-pages"
cancel-in-progress: false
jobs:
build-and-deploy:
name: Build and deploy
runs-on: ubuntu-latest
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
defaults:
run:
working-directory: ./static-site
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
with:
node-version-file: ./static-site/.nvmrc
- name: Install lib dependencies
working-directory: ./lib
run: npm ci --no-fund --prefer-offline --no-audit
- name: Install static-site dependencies
run: npm ci --no-fund --prefer-offline --no-audit
- run: npm run build
- name: Upload site
uses: actions/upload-pages-artifact@v1
if: ${{ github.ref == 'refs/heads/main' }}
with:
path: ./static-site/build
- name: Deploy site
uses: actions/deploy-pages@v2
id: deployment
if: ${{ github.ref == 'refs/heads/main' }}