steps: #kaniko - name: 'gcr.io/kaniko-project/executor:latest' id: kaniko args: [ "--dockerfile=./Dockerfile", "--context=dir:///workspace/docs", "--cache=false", "--cache-ttl=1h", "--destination=us-west1-docker.pkg.dev/${PROJECT_ID}/docusaurus/docusaurus:${_PR_NUMBER}-${SHORT_SHA}", ] - id: "deploy revision with tag" name: "gcr.io/google.com/cloudsdktool/cloud-sdk" entrypoint: "gcloud" args: [ "run", "deploy", "${_SERVICE_NAME}", "--platform", "managed", "--region", "${_REGION}", "--image", "us-west1-docker.pkg.dev/${PROJECT_ID}/docusaurus/docusaurus:${_PR_NUMBER}-${SHORT_SHA}", "--tag", "pr-${_PR_NUMBER}", "--no-traffic", ] - id: "link revision on pull request" name: "gcr.io/${PROJECT_ID}/deployment-previews" # our custom builder secretEnv: ["GITHUB_TOKEN"] args: [ "set", "--project-id", "${PROJECT_ID}", "--region", "${_REGION}", "--service", "${_SERVICE_NAME}", "--pull-request", "${_PR_NUMBER}", "--repo-name", "${_GITHUB_REPO}", "--commit-sha", "${SHORT_SHA}", ] timeout: 3600s substitutions: _SERVICE_NAME: docusaurus _REGION: us-west2 _GITHUB_REPO: $(pull_request.pull_request.head.repo.full_name) options: dynamicSubstitutions: true workerPool: 'projects/websitecloud-352908/locations/us-west2/workerPools/gke-vpn-pool' availableSecrets: secretManager: - versionName: projects/$PROJECT_ID/secrets/github_token/versions/latest env: "GITHUB_TOKEN"