From 4b6e2fe2236956d32102bddf74a979cb97fbf095 Mon Sep 17 00:00:00 2001 From: Gustavo Valverde Date: Mon, 8 May 2023 18:16:47 -0400 Subject: [PATCH] fix(build): sync LWD builder with our `build-docker-image.yml` workflow (#6634) After migrating to our new GCP project, some references were not being applied correctly, as this workflow was not referencing new resources the right way. It was even outdated on some specific parts. --- .github/workflows/zcash-lightwalletd.yml | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/.github/workflows/zcash-lightwalletd.yml b/.github/workflows/zcash-lightwalletd.yml index cd4d1262..e0cf9533 100644 --- a/.github/workflows/zcash-lightwalletd.yml +++ b/.github/workflows/zcash-lightwalletd.yml @@ -1,3 +1,5 @@ +# TODO: we should stop using this build approach with lightwalletd and move to using our +# reusable workflow to building all the docker images of our repo name: zcash-lightwalletd # Ensures that only one workflow task will run at a time. Previous builds, if @@ -77,18 +79,21 @@ jobs: with: # list of Docker images to use as base name for tags images: | - ${{ vars.GAR_BASE }}/${{ env.IMAGE_NAME }} + us-docker.pkg.dev/${{ vars.GCP_PROJECT }}/zebra/${{ env.IMAGE_NAME }} # generate Docker tags based on the following events/attributes # set latest tag for default branch tags: | type=schedule - type=ref,event=branch - type=ref,event=pr + # semver and ref,tag automatically add a "latest" tag, but only on stable releases type=semver,pattern={{version}} type=semver,pattern={{major}}.{{minor}} type=semver,pattern={{major}} + type=ref,event=tag + type=ref,event=branch + type=ref,event=pr type=sha - type=raw,value=latest,enable={{is_default_branch}} + # edge is the latest commit on the default branch. + type=edge,enable={{is_default_branch}} - name: Set up QEMU id: qemu @@ -142,5 +147,8 @@ jobs: tags: ${{ steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} push: true - cache-from: type=registry,ref=${{ vars.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache - cache-to: type=registry,ref=${{ vars.GAR_BASE }}/${{ env.IMAGE_NAME }}:buildcache,mode=max + cache-from: | + type=registry,ref=us-docker.pkg.dev/${{ vars.GCP_PROJECT }}/zebra-caching/${{ env.IMAGE_NAME }}:${{ env.GITHUB_REF_SLUG_URL }}-cache + type=registry,ref=us-docker.pkg.dev/${{ vars.GCP_PROJECT }}/zebra-caching/${{ env.IMAGE_NAME }}:main-cache + cache-to: | + type=registry,ref=us-docker.pkg.dev/${{ vars.GCP_PROJECT }}/zebra-caching/${{ env.IMAGE_NAME }}:${{ env.GITHUB_REF_SLUG_URL }}-cache,mode=max