max*_*tSO 3 google-cloud-platform github-actions
我正在编写一个 GitHub Action,将我的应用程序部署到 GCP 的“Cloud Run”服务。
name: Deploy to production
on:
push:
branches:
- master
env:
PROJECT_ID: XXX
SERVICE_NAME: XXX
RUN_REGION: XXX
PACKAGE_VERSION : XXX
permissions:
contents: read
id-token: write
jobs:
deployment-job:
runs-on: ubuntu-latest
environment: production
steps:
- uses: actions/checkout@v2
- name: Authenticate to Google Cloud
uses: google-github-actions/auth@v0
with:
workload_identity_provider: XXX
service_account: XXX
- name: Deploy to Cloud Run
uses: google-github-actions/deploy-cloudrun@v0
with:
service: ${{ env.SERVICE_NAME }}
source: gcr.io/${{ env.PROJECT_ID }}/${{ env.SERVICE_NAME }}:${{ env.PACKAGE_VERSION }} # equivalent to "gcloud builds submit ..."
region: ${{ env.RUN_REGION }}
tag: ${{ env.PACKAGE_VERSION }}
Run Code Online (Sandbox Code Playgroud)
我遇到这个错误:
ERROR: (gcloud.beta.run.deploy) The user is forbidden from accessing the bucket [XXX]. Please check your organization's policy or if the user has the "serviceusage.services.use" permission
Run Code Online (Sandbox Code Playgroud)
我尝试将此权限添加到我的服务帐户,但我仍然遇到相同的错误:
ERROR: (gcloud.beta.run.deploy) The user is forbidden from accessing the bucket [XXX]. Please check your organization's policy or if the user has the "serviceusage.services.use" permission
Run Code Online (Sandbox Code Playgroud)
我通过本教程设置了工作负载身份联合。
| 归档时间: |
|
| 查看次数: |
3596 次 |
| 最近记录: |