Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 12 additions & 6 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,6 @@ jobs:
with:
fetch-depth: 2

- name: Check for Python file changes
uses: tj-actions/changed-files@v41
id: changed-files
with:
files: "**/*.py"

- name: Deploy to production
uses: appleboy/ssh-action@v1.0.3
with:
Expand Down Expand Up @@ -53,6 +47,7 @@ jobs:
echo "MAIL_USERNAME=${{ secrets.MAIL_USERNAME }}" > .env
echo "MAIL_PASSWORD=${{ secrets.MAIL_PASSWORD }}" >> .env
echo "AOC_SESSION_COOKIE=${{ secrets.AOC_SESSION_COOKIE }}" >> .env
echo "SU_KEY=${{ secrets.SU_KEY }}" >> .env

- name: Install dependencies
if: success()
Expand All @@ -76,6 +71,17 @@ jobs:
cd ~/website/
FLASK_APP=codesoc.py flask db-validate

- name: Run database migrations
if: success()
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.VM_HOST }}
username: ${{ secrets.VM_USER }}
key: ${{ secrets.VM_SSH_KEY }}
script: |
cd ~/website/
FLASK_APP=codesoc.py flask db upgrade

- name: Reset database
if: success()
uses: appleboy/ssh-action@v1.0.3
Expand Down