CloudOps

源文件

.github/workflows/gcp-deploy.yml

离线配置。未部署到任何云账号。

name: gcp-deploy
on:
  workflow_dispatch:
  push:
    branches: [main]
permissions:
  id-token: write
  contents: read
jobs:
  deploy:
    runs-on: ubuntu-latest
    timeout-minutes: 30
    steps:
      - name: checkout
        uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2
      - name: Authenticate to Google Cloud
        uses: google-github-actions/auth@c200f3691d83b41bf9bbd8638997a462592937ed # v2.1.13
        with:
          workload_identity_provider: projects/000000000000/locations/global/workloadIdentityPools/github-pool/providers/github-provider
          service_account: github-deploy-sa@thistle-analytics-demo.iam.gserviceaccount.com
      - name: show the documented project
        env:
          PROJECT_ID: thistle-analytics-demo
          REGION: asia-east1
          SERVICE: insights-api
        run: |
          echo "Offline demo. make check does not run this workflow."
          echo "project=${PROJECT_ID} region=${REGION} service=${SERVICE}"