Added INSTALL_LATEST for manual trigger so it's somewhat testable. #514
Workflow file for this run
This file contains hidden or 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
| # Update the Mobility Database Schema | ||
| name: Database Update - DEV | ||
| on: | ||
| push: # Update on merge on master if the changelog file or populate script have been updated | ||
| branches: | ||
| - main | ||
| paths: | ||
| - 'liquibase/changelog.xml' | ||
| - 'api/src/scripts/populate_db*' | ||
| repository_dispatch: # Update on mobility-database-catalog repo dispatch | ||
| types: [ catalog-sources-updated, gbfs-systems-updated ] | ||
| workflow_dispatch: | ||
| inputs: | ||
| DRY_RUN: | ||
| description: Dry run. Skip applying schema and content updates | ||
| required: false | ||
| default: false | ||
| type: boolean | ||
| jobs: | ||
| update: | ||
| uses: ./.github/workflows/db-update.yml | ||
| with: | ||
| PROJECT_ID: ${{ vars.DEV_MOBILITY_FEEDS_PROJECT_ID }} | ||
| REGION: ${{ vars.MOBILITY_FEEDS_REGION }} | ||
| DB_NAME: ${{ vars.DEV_POSTGRE_SQL_DB_NAME }} | ||
| ENVIRONMENT: ${{ vars.DEV_MOBILITY_FEEDS_ENVIRONMENT }} | ||
| DB_ENVIRONMENT: ${{ vars.QA_MOBILITY_FEEDS_ENVIRONMENT }} | ||
| API_BASE_URL: api-dev.mobilitydatabase.org | ||
| # DRY_RUN is only if requested by the user in a workflow_dispatch | ||
| DRY_RUN: ${{ github.event_name == 'workflow_dispatch' && inputs.DRY_RUN }} | ||
| # We want to use the currently installed version (not the latest) if we received a dispatch from | ||
| # mobility_database_catalog. | ||
| # For a workflow_dispatch (manual trigger), we use the value set by the user. | ||
| INSTALL_LATEST: ${{ | ||
| (github.event_name == 'repository_dispatch' && false) || | ||
| (github.event_name == 'workflow_dispatch' && inputs.INSTALL_LATEST) | ||
| } } | ||
| secrets: | ||
| DB_USER_PASSWORD: ${{ secrets.DEV_POSTGRE_USER_PASSWORD }} | ||
| DB_USER_NAME: ${{ secrets.DEV_POSTGRE_USER_NAME }} | ||
| DB_INSTANCE_NAME: ${{ secrets.DB_INSTANCE_NAME }} | ||
| GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.DEV_GCP_MOBILITY_FEEDS_SA_KEY }} | ||
| DB_GCP_MOBILITY_FEEDS_SA_KEY: ${{ secrets.QA_GCP_MOBILITY_FEEDS_SA_KEY }} | ||
| OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | ||
| OP_FEEDS_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_FEEDS_SERVICE_ACCOUNT_TOKEN }} | ||
| POSTGRE_SQL_INSTANCE_NAME: ${{ secrets.DB_INSTANCE_NAME }} | ||
| API_TEST_REFRESH_TOKEN: ${{ secrets.DEV_API_TEST_REFRESH_TOKEN }} | ||
| notify-slack-on-failure: | ||
| needs: [ update ] | ||
| if: always() && (needs.update.result == 'failure') && (github.event_name == 'repository_dispatch') | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout code | ||
| uses: actions/checkout@v4 | ||
| - name: Notify Slack | ||
| uses: ./.github/actions/notify-slack | ||
| with: | ||
| OP_SERVICE_ACCOUNT_TOKEN: ${{ secrets.OP_SERVICE_ACCOUNT_TOKEN }} | ||
| PRIORITY: "high" | ||