-
Notifications
You must be signed in to change notification settings - Fork 0
30 lines (24 loc) · 930 Bytes
/
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
name: Auto-Deploy Flask App
on:
push:
branches:
- main
jobs:
deploy:
runs-on: [self-hosted]
steps:
- name: Fix permissions
run: sudo chown -R $USER:$USER /home/githubrunner/actions-runner/_work/Maze-Solver
- name: Checkout code
uses: actions/checkout@v2
with:
path: /home/githubrunner/actions-runner/_work/Maze-Solver/Maze-Solver
- name: Update system code
run: |
sudo systemctl stop flaskapp.service
sudo rsync -av --delete /home/githubrunner/actions-runner/_work/Maze-Solver/Maze-Solver/ /home/githubrunner/actions-runner/_work/Maze-Solver/Maze-Solver/
sudo chown -R githubrunner:githubrunner /home/githubrunner/actions-runner/_work/Maze-Solver/Maze-Solver/
sudo systemctl start flaskapp.service
- name: Verify service is running
run: |
sudo systemctl status flaskapp.service