Skip to content

Commit

Permalink
Add github workflow for analytics migrations
Browse files Browse the repository at this point in the history
  • Loading branch information
jjnesbitt committed Aug 23, 2023
1 parent bc291d0 commit 0d5b0e6
Showing 1 changed file with 26 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/analytics_migrations.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
name: Check and Run Analytics Migrations

on:
pull_request:
paths:
- analytics/analytics

jobs:
check-and-run-migrations:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3

# If models have been changed and thus `makemigrations` must be run, this check fails
- name: Check for Migrations
run: ./analytics/manage.py makemigrations --check --dry-run

# If the previous check was successful, run any necessary migrations
- name: Run Migrations
run: ./analytics/manage.py migrate
env:
DB_NAME: ${{ secrets.ANALYTICS_DB_NAME }}
DB_USER: ${{ secrets.ANALYTICS_DB_USER }}
DB_PASS: ${{ secrets.ANALYTICS_DB_PASS }}
DB_HOST: ${{ secrets.ANALYTICS_DB_HOST }}

0 comments on commit 0d5b0e6

Please sign in to comment.