report index generator #238
This file contains 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
name: 'report index generator' | |
on: | |
workflow_dispatch: {} | |
schedule: | |
# trigger at 1:42am on Tuesday and Thursday | |
# set during the hour to reduce collisions | |
- cron: '42 1 * * 2,4' | |
permissions: | |
id-token: write | |
jobs: | |
build_report_index: | |
runs-on: ubuntu-latest | |
env: | |
VERSION: 5.2.0 | |
steps: | |
- id: "google-cloud-auth" | |
name: "Authenticate to Google Cloud" | |
uses: google-github-actions/auth@v1 | |
with: | |
workload_identity_provider: "projects/847315747340/locations/global/workloadIdentityPools/github-pool/providers/github-provider" | |
service_account: "[email protected]" | |
- id: "google-cloud-sdk-setup" | |
name: "Set up Cloud SDK" | |
uses: google-github-actions/setup-gcloud@v1 | |
- name: "Submit report crawler" | |
run: | | |
TOKEN=$(gcloud auth print-identity-token --impersonate-service-account="[email protected]" --audiences="https://server-a2pko7ameq-ts.a.run.app" --include-email) | |
curl --fail --silent --show-error -X POST \ | |
-H "Authorization: Bearer $TOKEN" \ | |
-H "Content-Type:application/json" \ | |
-d '{"output": "report_index_${{ steps.date.outputs.date }}", "dataset": "talos", "image": "australia-southeast1-docker.pkg.dev/cpg-common/images/talos:${{ env.VERSION }}", "accessLevel": "full", "repo": "automated-interpretation-pipeline", "commit": "${{ github.sha }}", "cwd": ".", "script": ["BuildReportIndexPage"], "description": "Build Talos Report Index Page", "wait": false}' \ | |
https://server-a2pko7ameq-ts.a.run.app |