-
Notifications
You must be signed in to change notification settings - Fork 8
68 lines (58 loc) · 1.32 KB
/
gh-pages.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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
name: gh-pages
on:
push:
branches: [ public ]
pull_request:
branches: [ public ]
workflow_dispatch: # or manual
permissions:
contents : read
pages : write
id-token : write
concurrency:
group : ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress : true
jobs:
build:
runs-on: ubuntu-latest
steps:
-
name : Checkout
uses : actions/checkout@v3
-
name : Install node 16
uses : actions/setup-node@v3
with :
node-version : 16
cache : 'npm'
-
name : Install node_modules
run : npm ci --legacy-peer-deps
-
name : Build static files
run : npm run build
-
name : Build artifacts
run : |
cd ./dist/
tar -cvf ../artifact.tar ./
-
name : Upload artifacts
uses : actions/upload-artifact@v3
with :
name : github-pages
path : artifact.tar
if-no-files-found : error
deploy:
needs:
- build
runs-on: ubuntu-latest
if: ${{ github.event_name != 'pull_request' }}
environment:
name : github-pages
url : ${{ steps.deployment.outputs.page_url }}
steps:
-
name : Deploy artifacts to github pages
uses : actions/deploy-pages@v1
id : deployment