-
Notifications
You must be signed in to change notification settings - Fork 35
55 lines (51 loc) · 1.32 KB
/
main.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
54
55
name: Deploy app
on:
push:
branches:
- 'master'
jobs:
build:
name: Build Artifacts for Test
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Build Artifacts
uses: actions/checkout@v3
- name: Init Node.js
uses: actions/setup-node@v1
with:
node-version: 16.x
- name: Up Caches
uses: actions/cache@v2
with:
path: '**/node_modules'
key: ${{ runner.os }}-modules-${{ hashFiles('**/yarn.lock') }}
- name: Generate deployable artifacts
run: |
yarn
CI=false yarn build
- name: Store Artifacts
uses: actions/upload-artifact@v3
with:
name: ${{ github.sha }}
path: build
retention-days: 1
deploy:
needs: build
name: Deploy
runs-on: ubuntu-latest
timeout-minutes: 5
steps:
- name: Extract Artifacts
uses: actions/download-artifact@v3
with:
name: ${{ github.sha }}
path: ~/build
- name: Deploy to host
uses: garygrossgarten/github-action-scp@release
with:
local: /home/runner/build
remote: /data/explorer/front/build
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
privateKey: ${{ secrets.DEPLOY_KEY }}