-
Notifications
You must be signed in to change notification settings - Fork 0
37 lines (33 loc) · 1.16 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
name: Main CI
on:
push:
branches: [ main ]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v1
- name: Copy files to prod server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
source: "."
target: ${{ secrets.PATH }}
- name: Restart
uses: appleboy/[email protected]
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USER }}
key: ${{ secrets.SSH_KEY }}
port: ${{ secrets.SSH_PORT }}
envs: NODE_ENV,CALENDAR_ID,EARNINGS_HEADSUP_DAYS,GCP_CLIENT_EMAIL,GCP_PRIVATE_KEY
script: |
source ~/.profile
cd ${{ secrets.PATH }}
rm -rf .git
pnpm i
pnpm run prod:stop
NODE_ENV=${{ secrets.NODE_ENV }} CALENDAR_ID=${{ secrets.CALENDAR_ID }} EARNINGS_HEADSUP_DAYS=${{ secrets.EARNINGS_HEADSUP_DAYS }} GCP_CLIENT_EMAIL=${{ secrets.GCP_CLIENT_EMAIL }} GCP_PRIVATE_KEY="${{ secrets.GCP_PRIVATE_KEY }}" pnpm run prod:start