-
Notifications
You must be signed in to change notification settings - Fork 1
36 lines (25 loc) · 907 Bytes
/
ci-prod.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
name: CI-Prod
on:
push:
branches: [ mfr-api-prod ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- name: Deploy to VPS
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
port: ${{ secrets.SERVER_PORT }}
username: ${{ secrets.SERVER_USER }}
password: ${{ secrets.SERVER_KEY }}
script: |
set -e
cd /opt/mfl_api
if ! [[ -d './.git' ]]; then git init; fi
if ! [[ `git remote -v | awk '{print $1}' | head -n 1` =~ 'origin' ]]; then git remote add origin ${{ github.server_url }}${{ github.username }}/${{ github.repository }}.git; fi
git stash
git pull origin mfr-api-prod
echo ${{ secrets.SERVER_KEY }} | sudo -S service supervisor restart