-
Notifications
You must be signed in to change notification settings - Fork 3
41 lines (35 loc) · 912 Bytes
/
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
name: Deploy
on:
push:
branches:
- "main"
pull_request:
branches:
- "main"
types:
- closed
env:
GIT_SSH_COMMAND: ssh -i /home/ubuntu/binsar/.ssh/id_rsa_personal_asistant -o IdentitiesOnly=yes
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Pull commit
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Deploy
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.HOST }}
username: ${{ secrets.USERNAME }}
port: ${{ secrets.PORT }}
key: ${{ secrets.SSHKEY }}
envs: GIT_SSH_COMMAND
script: |
cd ${{ secrets.SERVER_CWD }}
yarn install --production
yarn build
GEMINI_KEY="${{ secrets.GEMINI_KEY }}" pm2 restart ecosystem.config.js --update-env
history -d $(history 2 | awk '{print $1}')
pm2 save