88 tags :
99 - ' v*'
1010
11- # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
11+ # Sets the permissions granted to the `GITHUB_TOKEN` for the actions in this job.
1212permissions :
1313 contents : read
1414 packages : write
@@ -19,6 +19,7 @@ concurrency:
1919
2020env :
2121 IMAGE_NAME : evm-block-extractor
22+ GCP_REGISTRY : us-east4-docker.pkg.dev
2223
2324jobs :
2425 deploy-to-github :
@@ -35,13 +36,19 @@ jobs:
3536 username : ${{ github.actor }}
3637 password : ${{ secrets.GITHUB_TOKEN }}
3738
39+ - name : Extract metadata (tags, labels) for Docker
40+ id : gh-meta
41+ uses : docker/metadata-action@v5
42+ with :
43+ images : ghcr.io/${{ github.repository_owner }}/${{ env.IMAGE_NAME }}
44+
3845 - name : Build and push Docker image to GitHub Container Registry
3946 uses : docker/build-push-action@v5
4047 with :
4148 context : .
4249 file : ./src/evm-block-extractor/Dockerfile
4350 push : true
44- tags : ghcr.io/ ${{ github.repository_owner }}/${{ env.IMAGE_NAME }}:latest
51+ tags : ${{ steps.gh-meta.outputs.tags }}
4552
4653 deploy-to-gcp :
4754 runs-on : ubuntu-latest
@@ -53,14 +60,20 @@ jobs:
5360 - name : Log in to GCP Registry
5461 uses : docker/login-action@v3
5562 with :
56- registry : us-east4-docker.pkg.dev
63+ registry : ${{env.GCP_REGISTRY}}
5764 username : _json_key
5865 password : ${{ secrets.EXTRACTOR_GCP_DOCKER_KEY }}
5966
67+ - name : Extract metadata (tags, labels) for Docker
68+ id : gcp-meta
69+ uses : docker/metadata-action@v5
70+ with :
71+ images : ${{env.GCP_REGISTRY}}/extractor-410310/block-extractor-repo/${{ env.IMAGE_NAME }}
72+
6073 - name : Build and push Docker image to GCP Registry
6174 uses : docker/build-push-action@v5
6275 with :
6376 context : .
6477 file : ./src/evm-block-extractor/Dockerfile
6578 push : true
66- tags : us-east4-docker.pkg.dev/extractor-410310/block-extractor-repo/ ${{ env.IMAGE_NAME }}:latest
79+ tags : ${{ steps.gcp-meta.outputs.tags }}
0 commit comments