Skip to content

Commit

Permalink
Update main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jackh54 authored Nov 15, 2024
1 parent c78d2db commit 774cf71
Showing 1 changed file with 8 additions and 12 deletions.
20 changes: 8 additions & 12 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ name: Auto-Deploy Flask App
on:
push:
branches:
- main # Run on pushes to the main branch
- main

jobs:
deploy:
Expand All @@ -20,17 +20,13 @@ jobs:
with:
python-version: '3.12'

- name: Install dependencies
- name: Update system code
run: |
cd /home/githubrunner/actions-runner/_work/Maze-Solver/Maze-Solver
pip install -r requirements.txt
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: Start Flask App
- name: Verify service is running
run: |
nohup python app.py > flask.log 2>&1 &
- name: Output Deployment URL
run: |
cd /home/githubrunner/actions-runner/_work/Maze-Solver/Maze-Solver
echo "App deployed" | tee url.txt
sudo systemctl status flaskapp.service

0 comments on commit 774cf71

Please sign in to comment.