Skip to content

Update validation reports after GTFS Validator has been updated #14

Update validation reports after GTFS Validator has been updated

Update validation reports after GTFS Validator has been updated #14

name: Update validation reports after GTFS Validator has been updated
on:
workflow_dispatch: # Supports manual trigger
repository_dispatch:
types: [
gtfs-validator-release, # Triggered by a release from the Canonical GTFS Validator
]
jobs:
validator-update:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
- name: Authenticate to Google Cloud
id: gcloud_auth
uses: google-github-actions/auth@v2
with:
credentials_json: ${{ secrets.PROD_GCP_MOBILITY_FEEDS_SA_KEY }}
- name: GCloud Setup
uses: google-github-actions/setup-gcloud@v2
- name: Set environment variables
run: |
echo "ENVIRONMENT=${{ vars.PROD_MOBILITY_FEEDS_ENVIRONMENT }}" >> $GITHUB_ENV
echo "PROJECT_ID=${{ vars.PROD_MOBILITY_FEEDS_PROJECT_ID }}" >> $GITHUB_ENV
echo "DEPLOYER_SERVICE_ACCOUNT=${{ vars.PROD_MOBILITY_FEEDS_DEPLOYER_SERVICE_ACCOUNT }}" >> $GITHUB_ENV
# Schedule a task to update the validation report in 24 hours from now to allow runners of the web validator
# to be properly updated with the new version of the GTFS Validator
- name: Create task to run cloud function
run: |
gcloud tasks create-http-task \
--queue=update-validation-report-task-queue \
--url=https://${ENVIRONMENT}-${PROJECT_ID}.cloudfunctions.net/update-validation-report \
--schedule-time=$(date -u -d "+24 hours" +%Y-%m-%dT%H:%M:%SZ) \
--oidc-service-account-email=${DEPLOYER_SERVICE_ACCOUNT} \
--location=${{ vars.MOBILITY_FEEDS_REGION }}