Skip to content

Commit

Permalink
Update docker-build-scan.yaml
Browse files Browse the repository at this point in the history
Improving the docker tagging logic.

[Context](https://github.com/orgs/community/discussions/25191) (thanks @alvarof2 for the link)
  • Loading branch information
jcortejoso authored Jun 28, 2024
1 parent 8fed632 commit 4cd14b0
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions .github/workflows/docker-build-scan.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@ jobs:

build-cel2-migration-tool:
runs-on: ubuntu-latest
env:
GIT_COMMIT: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
needs: detect-files-changed
if: |
contains(needs.detect-files-changed.outputs.files-changed, 'op-chain-ops/cmd/celo-migrate') ||
Expand All @@ -48,7 +50,7 @@ jobs:
with:
platforms: linux/amd64
registry: us-west1-docker.pkg.dev/devopsre/dev-images/cel2-migration-tool
tags: ${{ github.sha }}
tags: ${{ env.GIT_COMMIT }}
context: ./
dockerfile: ./op-chain-ops/Dockerfile
push: true
Expand All @@ -72,9 +74,9 @@ jobs:
id-token: write
security-events: write
env:
GIT_COMMIT: ${{ github.sha }}
GIT_COMMIT: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
GIT_DATE: ${{ github.event.head_commit.timestamp }}
IMAGE_TAGS: ${{ github.sha }},latest
IMAGE_TAGS: ${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || (github.event_name == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/celo')) && 'latest,' || '') }}${{ github.sha }}
REGISTRY: us-west1-docker.pkg.dev
REPOSITORY: blockchaintestsglobaltestnet/dev-images
steps:
Expand Down

0 comments on commit 4cd14b0

Please sign in to comment.