-
Notifications
You must be signed in to change notification settings - Fork 2
43 lines (41 loc) · 1.21 KB
/
automated_api_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
41
42
43
name: Deploy Astroid API update via Github Actions
on:
push:
branches:
- main
jobs:
pull_changes:
runs-on: ubuntu-latest
file-depth: 1
steps:
- name: API Shutdown
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
sudo systemctl stop astroidapi
- name: Pull changes
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
cd /root/astroid
git pull origin main
deploy:
runs-on: ubuntu-latest
steps:
- name: Deploy the API
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SSH_HOST }}
username: ${{ secrets.SSH_USER }}
password: ${{ secrets.SSH_PASSWORD }}
port: ${{ secrets.SSH_PORT }}
script: |
sudo systemctl start astroidapi