-
Notifications
You must be signed in to change notification settings - Fork 0
52 lines (50 loc) · 1.46 KB
/
deploy.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
name: deploy
env:
DEPLOY_PACKAGE_NAME: "DEPLOY-VER-${{github.sha}}"
NODE_VERSION: 14
on: release
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Use Node.js ${{ env.NODE_VERSION }}
uses: actions/setup-node@v2
with:
node-version: ${{ env.NODE_VERSION }}
- uses: actions/checkout@v2
- name: npm install and build
run: |
npm install
npm run build:prod
- name: transfer package.json to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: root
passphrase: ${{ secrets.PASSPHRASE }}
key: ${{ secrets.PRIVATE_KEY }}
source: "dist/package.json"
target: "baby_app"
strip_components: 1
- name: Server - npm install with new package.json
uses: garygrossgarten/github-action-ssh@release
with:
command: |
export NVM_DIR=~/.nvm
source ~/.nvm/nvm.sh
cd baby_app
npm install
host: ${{ secrets.HOST }}
username: root
passphrase: ${{ secrets.PASSPHRASE }}
privateKey: ${{ secrets.PRIVATE_KEY}}
- name: transfer app.js to Server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: root
passphrase: ${{ secrets.PASSPHRASE }}
key: ${{ secrets.PRIVATE_KEY }}
source: "dist/app.js"
target: "baby_app"
strip_components: 1