Skip to content

Commit

Permalink
chore(ci): generate the Docker tag latest-ubuntu only for the latest …
Browse files Browse the repository at this point in the history
…commit on the default branch

KAG-4374
  • Loading branch information
Water-Melon committed Jun 4, 2024
1 parent 34701ca commit a740612
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -597,14 +597,20 @@ jobs:
username: ${{ secrets.GHA_DOCKERHUB_PUSH_USER }}
password: ${{ secrets.GHA_KONG_ORG_DOCKERHUB_PUSH_TOKEN }}

- uses: actions/checkout@v3

- name: Get latest commit SHA on master
run: |
echo "latest_sha=$(git ls-remote origin -h refs/heads/${{ github.event.inputs.default_branch }} | cut -f1)" >> $GITHUB_ENV
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: ${{ needs.metadata.outputs.docker-repository }}
sep-tags: " "
tags: |
type=raw,value=latest,enable=${{ matrix.label == 'ubuntu' }}
type=raw,value=latest,enable=${{ matrix.label == 'ubuntu' && github.ref_name == github.event.inputs.default_branch && env.latest_sha == github.event.pull_request.head.sha }}
type=match,enable=${{ github.event_name == 'workflow_dispatch' }},pattern=\d.\d,value=${{ github.event.inputs.version }}
type=match,enable=${{ github.event_name == 'workflow_dispatch' && matrix.label == 'ubuntu' }},pattern=\d.\d,value=${{ github.event.inputs.version }},suffix=
type=raw,enable=${{ github.event_name == 'workflow_dispatch' }},${{ github.event.inputs.version }}
Expand Down

0 comments on commit a740612

Please sign in to comment.