-
Notifications
You must be signed in to change notification settings - Fork 1
58 lines (49 loc) · 1.18 KB
/
build-and-deploy.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
name: Build and Deploy
on:
push:
branches: [ "master" ]
paths-ignore:
- 'README.md'
- 'LICENSE'
- '.gitignore'
workflow_dispatch:
permissions:
pages: write
id-token: write
contents: read
jobs:
build:
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@v3
- name: Setup Node.js environment
uses: actions/setup-node@v3
with:
node-version: "16"
cache: 'yarn'
- name: Bootstrap dependencies
run: |
sudo apt install -y fonts-noto-color-emoji fonts-wqy-microhei
- name: Bootstrap node environment
run: |
yarn
- name: Build HTML dist files
run: |
if [ -z "$BASE_PREFIX" ]; then
export BASE_PREFIX="/$(echo "$GITHUB_REPOSITORY" | cut -d '/' -f 2)/"
fi
yarn build
- name: Upload HTML dist files to artifacts
uses: actions/upload-pages-artifact@v1
with:
path: dist/client
deploy:
runs-on: ubuntu-22.04
needs: build
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v1