Skip to content

Merge pull request #1516 from cityofaustin/v2.0.0 #37

Merge pull request #1516 from cityofaustin/v2.0.0

Merge pull request #1516 from cityofaustin/v2.0.0 #37

#
# Applies database migrations to staging (master) and production
#
name: "Applies the migrations to the database"
on:
push:
branches:
- master
- production
paths:
- "atd-vzd/**"
- ".github/workflows/apply_db_migrations_and_metadata.yml"
- ".github/workflows/migration-helper.sh"
workflow_dispatch:
inputs:
description:
default: ""
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