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 and karlb committed Sep 10, 2024
1 parent 50373f4 commit 51150f8
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, 'go.sum') ||
Expand All @@ -49,7 +51,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 @@ -73,9 +75,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 == 'push' && (github.ref == 'refs/heads/master' || startsWith(github.ref, 'refs/heads/celo')) && 'latest,' || '') }}${{ github.event_name == 'pull_request' && github.event.pull_request.head.sha || github.sha }}
REGISTRY: us-west1-docker.pkg.dev
REPOSITORY: blockchaintestsglobaltestnet/dev-images
steps:
Expand Down

0 comments on commit 51150f8

Please sign in to comment.