Skip to content

Merge pull request #1143 from cityofaustin/cb-unique-signal-key #357

Merge pull request #1143 from cityofaustin/cb-unique-signal-key

Merge pull request #1143 from cityofaustin/cb-unique-signal-key #357

#
# Applies database migrations to staging (main) and production
#
name: "Applies the migrations to the database"
on:
push:
branches:
- main
- production
paths:
- "moped-database/**"
- ".github/workflows/atd_moped_database.yml"
- ".github/workflows/aws-moped-migrations-helper.sh"
jobs:
apply:
name: Apply Migrations
runs-on: ubuntu-20.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 AWC CLI tools & boto3
- name: "Install AWS Cli & Hasura CLI"
run: |
sudo apt-get install python3-setuptools
pip3 install awscli virtualenv
curl -L https://github.com/hasura/graphql-engine/raw/stable/cli/get.sh | bash
# Run the shell commands using the AWS environment variables
- name: "Apply"
env:
AWS_DEFAULT_REGION: ${{ secrets.AWS_DEFAULT_REGION }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_MOPED_HASURA_CONFIGURAITON_FILE_PRODUCTION: ${{ secrets.AWS_MOPED_HASURA_CONFIGURAITON_FILE_PRODUCTION }}
AWS_MOPED_HASURA_CONFIGURAITON_FILE_STAGING: ${{ secrets.AWS_MOPED_HASURA_CONFIGURAITON_FILE_STAGING }}
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/aws-moped-migrations-helper.sh
run_migration_process