Merge pull request #1565 from cityofaustin/jc-more-docs #53
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# | |
# 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 |