Skip to content

Dispatch Updater

Dispatch Updater #24

name: Dispatch Updater
on:
workflow_dispatch:
inputs:
command:
description: Updater Command to run
default: database-health-check
type: choice
options:
- database-health-check
- update-elections
- update-candidates-current
- update-candidates-past
- update-candidates-info
- update-transactions-current
- update-transactions-past
# - zip-codes
# - jurisdiction-zip-codes
- update-zip-codes
- initialize-data
environment:
description: Environment
default: staging
type: choice
options:
- staging
- production
jobs:
run-updater-action:
name: Run command ${{ inputs.command }} on ${{ inputs.environment }}
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: set App id for staging
if: ${{ inputs.environment == 'staging' }}
run: echo "APP_ID=$(echo $APP_ID)" >> $GITHUB_ENV
shell: bash
env:
APP_ID: ${{ secrets.STAGING_HEROKU_APP_ID }}
- name: set App id for production
if: ${{ inputs.environment == 'production' }}
run: echo "APP_ID=$(echo $APP_ID)" >> $GITHUB_ENV
shell: bash
env:
APP_ID: ${{ secrets.PRODUCTION_HEROKU_APP_ID }}
- id: updater
uses: ./.github/actions/updater
with:
command: ${{ inputs.command }}
APP_ID: ${{ env.APP_ID }}
HEROKU_API_KEY: ${{ secrets.HEROKU_API_KEY }}