-
Notifications
You must be signed in to change notification settings - Fork 106
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
fix(build): secrets, runner and conditional login
- Loading branch information
1 parent
9dbdfe2
commit 773b0b5
Showing
4 changed files
with
11 additions
and
8 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -68,7 +68,7 @@ jobs: | |
build: | ||
name: Build images | ||
timeout-minutes: 210 | ||
runs-on: ubuntu-latest-xl | ||
runs-on: ubuntu-latest | ||
outputs: | ||
image_digest: ${{ steps.docker_build.outputs.digest }} | ||
image_name: ${{ fromJSON(steps.docker_build.outputs.metadata)['image.name'] }} | ||
|
@@ -92,6 +92,8 @@ jobs: | |
uses: docker/[email protected] | ||
with: | ||
# list of Docker images to use as base name for tags | ||
# We only publish images to DockerHub if a release is not a pre-release | ||
# Ref: https://github.com/orgs/community/discussions/26281#discussioncomment-3251177 | ||
images: | | ||
us-docker.pkg.dev/${{ vars.GCP_PROJECT }}/zebra/${{ inputs.image_name }} | ||
zfnd/${{ inputs.image_name }},enable=${{ github.event_name == 'release' && !github.event.release.prerelease }} | ||
|
@@ -139,25 +141,19 @@ jobs: | |
password: ${{ steps.auth.outputs.access_token }} | ||
|
||
- name: Login to DockerHub | ||
# We only publish images to DockerHub if a release is not a pre-release | ||
# Ref: https://github.com/orgs/community/discussions/26281#discussioncomment-3251177 | ||
if: ${{ github.event_name == 'release' && !github.event.release.prerelease }} | ||
uses: docker/[email protected] | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
|
||
# Setup Docker Buildx to allow use of docker cache layers from GH | ||
# Setup Docker Buildx to use Docker Build Cloud | ||
- name: Set up Docker Buildx | ||
id: buildx | ||
uses: docker/setup-buildx-action@v3 | ||
with: | ||
version: "lab:latest" | ||
driver: cloud | ||
endpoint: "zfnd/zebra" | ||
driver-opts: | | ||
network=host | ||
image=moby/buildkit:v0.13.0 | ||
|
||
# Build and push image to Google Artifact Registry, and possibly DockerHub | ||
- name: Build & push | ||
|