Skip to content

Commit 0229788

Browse files
feat(build): add docker metadata step and streamline image tagging
1 parent 48eeae1 commit 0229788

1 file changed

Lines changed: 11 additions & 4 deletions

File tree

.github/workflows/build.yml

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,21 @@ jobs:
4343
echo "TAG=${GITHUB_REF#refs/*/}" >> $GITHUB_ENV
4444
echo "IMAGE_NAME=ghcr.io/${GITHUB_ACTOR,,}/fsb" >> $GITHUB_ENV
4545
46+
- name: Docker meta
47+
id: meta
48+
uses: docker/metadata-action@v5
49+
with:
50+
images: ghcr.io/${{ github.actor }}/fsb
51+
tags: |
52+
type=ref,event=tag
53+
type=raw,value=latest,enable=${{ !contains(github.ref, '-') }}
54+
4655
- name: Build docker image and push
4756
uses: docker/build-push-action@v5
48-
env:
49-
IMAGE_NAME: ${{ steps.env-vars.outputs.IMAGE_NAME }}
50-
TAG: ${{ steps.env-vars.outputs.TAG }}
5157
with:
5258
context: ./
5359
pull: true
5460
push: true
5561
platforms: linux/amd64,linux/arm64
56-
tags: ${{ env.IMAGE_NAME }}:${{ env.TAG }} , ${{ env.IMAGE_NAME }}:latest
62+
tags: ${{ steps.meta.outputs.tags }}
63+
labels: ${{ steps.meta.outputs.labels }}

0 commit comments

Comments
 (0)