Skip to content

Commit

Permalink
Extract TAG_PREFIX
Browse files Browse the repository at this point in the history
  • Loading branch information
basnijholt committed Dec 12, 2023
1 parent 98d7ea3 commit 7563bd4
Showing 1 changed file with 11 additions and 5 deletions.
16 changes: 11 additions & 5 deletions .github/workflows/publish_image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -36,16 +36,22 @@ jobs:
- name: Setup Docker buildx
uses: docker/setup-buildx-action@dc7b9719a96d48369863986a06765841d7ea23f6 # v2.0.0

- name: Prepare metadata
- name: Extract tag prefix
id: extract_tag
run: |
TAG_PREFIX=$(echo "${{ matrix.base-image }}" | sed -E 's/[^:]+:([^@]+)@.*/\1/')
echo "TAG_PREFIX=$TAG_PREFIX" >> $GITHUB_ENV
- name: Prepare metadata
id: meta
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a # v4.0.1
uses: docker/metadata-action@69f6fc9d46f2f8bf0d5491e4aabe0bb8c6a4678a
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=sha,enable=true,prefix=git-
type=raw,value=${{ env.TAG_PREFIX }}
type=raw,value=latest
type=raw,value=${{ matrix.base-image | replace('/','-') | replace(':','-') | replace('@','-') }}
- name: Log into registry ${{ env.REGISTRY }}
uses: docker/login-action@49ed152c8eca782a232dede0303416e8f356c37b # v2.0.0
with:
Expand Down

0 comments on commit 7563bd4

Please sign in to comment.