Skip to content

Merge pull request #1602 from cityofaustin/v2.4.0 #65

Merge pull request #1602 from cityofaustin/v2.4.0

Merge pull request #1602 from cityofaustin/v2.4.0 #65

#
# Applies database migrations to staging (main) and production
#
name: "Applies the migrations to the database"
on:
push:
branches:
- main
- production
paths:
- "database/**"
- ".github/workflows/apply_db_migrations_and_metadata.yml"
- ".github/workflows/migration-helper.sh"
workflow_dispatch:
jobs:
apply:
name: Apply Migrations
runs-on: ubuntu-22.04
steps:
- uses: actions/setup-python@v4
with:
python-version: "3.8"
architecture: "x64"
# Get the code first
- name: "Checkout"
uses: actions/checkout@v3
# Then install the Hasura CLI and jq
- name: "Install Hasura CLI and jq"
run: |
sudo apt-get install jq
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
# Use Hasura CLI to apply migrations and then metadata
- name: "Apply"
env:
ZAPPA_SETTINGS: ${{ secrets.ZAPPA_SETTINGS }}
run: |
export BRANCH_NAME=${GITHUB_REF##*/}
echo "SHA: ${GITHUB_SHA}"
echo "ACTION/BRANCH_NAME: ${BRANCH_NAME}"
echo "GR: ${GITHUB_REF}"
echo "PWD: $(pwd)"
source $(pwd)/.github/workflows/migration-helper.sh
run_migration_process