-
Notifications
You must be signed in to change notification settings - Fork 2
53 lines (51 loc) · 1.6 KB
/
deploy-client.yml
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
name: Deploy client
on:
workflow_run:
workflows: ['Test']
branches: [main]
types:
- completed
jobs:
deploy:
name: Deploy
runs-on: ubuntu-latest
if: ${{ github.event.workflow_run.conclusion == 'success' }}
permissions:
contents: write
steps:
- uses: actions/checkout@v3
with:
ref: ${{ github.event.workflow_run.head_branch }}
- uses: actions/setup-node@v3
with:
node-version: 20
- uses: actions/cache@v2
id: root-npm-cache
with:
path: 'node_modules'
key: root-npm-${{ hashFiles('package-lock.json') }}
- uses: actions/cache@v2
id: client-npm-cache
with:
path: 'client/node_modules'
key: client-npm-${{ hashFiles('client/package-lock.json') }}
- uses: actions/cache@v2
id: server-npm-cache
with:
path: 'server/node_modules'
key: server-npm-${{ hashFiles('server/package-lock.json') }}
- run: npm install
if: steps.root-npm-cache.outputs.cache-hit != 'true'
- run: npm install --prefix client
if: steps.client-npm-cache.outputs.cache-hit != 'true'
- run: npm install --prefix server
if: steps.server-npm-cache.outputs.cache-hit != 'true'
- run: npm run build --prefix client
env:
API_BASE_PATH: ${{ vars.API_BASE_PATH }}
API_ORIGIN: ${{ vars.API_ORIGIN }}
- run: touch ./client/out/.nojekyll
- uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./client/out