-
Notifications
You must be signed in to change notification settings - Fork 4
51 lines (47 loc) · 2.02 KB
/
validator-update.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
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 }}
notify-slack-on-failure:
needs: [ validator-update ]
if: failure() && (github.event_name != 'workflow_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"