0

我有一个托管在 Google Cloud 存储上的个人网站。我在存储桶上部署网站的方式如下:

  • make deploy当我推动分支开发时,Github Actions 运行
  • Make deploy 正在运行一个名为bin/deploy.sh

我的 Google Cloud 帐户存在计费问题,因此我无法修改 GCS 存储桶上的任何内容。事实上,如果我在本地运行 make deploy,我会收到以下错误日志:

AccessDeniedException: 403 The project to be billed is associated with a delinquent billing account.
CommandException: 29 files/objects could not be copied/removed.
make: *** No rule to make target `do', needed by `deploy'.  Stop.

我的 Github Actions 管道成功,没有报告任何错误。 在此处输入图像描述

我应该何时以及如何捕获 gcloud 错误?

部署.sh

# set website config
gsutil web set -m index.html -e 404.html gs://pierre-alexandre.io

# add user permissions
gsutil iam ch allUsers:legacyObjectReader gs://pierre-alexandre.io

# copy the website files!
gsutil -m rsync -d -r public_html gs://pierre-alexandre.io

生成文件

deploy: $(shell ./bin/deploy.sh)

.github/workflows/main.yml

name: CI
on:
  push:
    branches: [ develop ]
  workflow_dispatch:

jobs:
  build:
    runs-on: ubuntu-latest

    steps:
      - uses: actions/checkout@v2

      - name: Deployment to production server 
        run: |
          echo deploying new version on pierre-alexandre.io ...
          echo make deploy
4

2 回答 2

1

该问题与您的帐户被暂停有关。恢复计费帐户是更新付款方式并结清未结余额并重新打开帐户,以便您可以使用其中的项目链接。

要更新付款方式,请参阅此页面上的步骤。

要重新打开结算帐户,请参阅此页面上的步骤。

于 2021-11-09T08:58:03.143 回答
1

除了@Mousu​​mi 提供的内容之外,请通过编写一些shell 脚本找到一个如何捕获 gstil 错误的示例。

于 2021-11-10T07:44:56.553 回答