Update main.yml #8
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Auto-Deploy Flask App | |
on: | |
push: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: [self-hosted] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
with: | |
path: /home/githubrunner/actions-runner/_work/Maze-Solver/Maze-Solver | |
- name: Set up Python | |
uses: actions/setup-python@v2 | |
with: | |
python-version: '3.12' | |
- 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 |