我有一个托管在 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