Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 7 additions & 3 deletions .github/workflows/deploy-bot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -45,12 +45,16 @@ jobs:

- uses: google-github-actions/setup-gcloud@v2

- name: Build the image
# Built here rather than on Cloud Build: the runner is already amd64, so there is
# nothing to cross-compile, and Cloud Build's staging bucket rejects a federated
# credential unless a quota project is threaded through it. One less moving part.
- name: Build and push the image
run: |
IMAGE="${REGION}-docker.pkg.dev/${PROJECT}/polygo/${SERVICE}:${GITHUB_SHA::7}"
echo "IMAGE=$IMAGE" >> "$GITHUB_ENV"
gcloud builds submit --config bot/cloudbuild.yaml \
--substitutions="_IMAGE=${IMAGE}" --project "$PROJECT" --quiet .
gcloud auth configure-docker "${REGION}-docker.pkg.dev" --quiet
docker build -f bot/Dockerfile -t "$IMAGE" .
docker push "$IMAGE"

- name: Roll it out
run: |
Expand Down
5 changes: 3 additions & 2 deletions bot/cloudbuild.yaml
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# Cloud Build builds the image, because bot/Dockerfile expects the repository root as its
# context and because a Mac builds arm64 while Cloud Run runs amd64.
# Cloud Build builds the image when you deploy from a Mac, which is arm64 while Cloud Run
# is amd64. The GitHub Actions deploy does not use this: its runner is already amd64, so it
# builds and pushes directly (.github/workflows/deploy-bot.yml).
# gcloud builds submit --config bot/cloudbuild.yaml --substitutions=_IMAGE=<image> .
steps:
- name: gcr.io/cloud-builders/docker
Expand Down
Loading