From f49e965dc21f483d848446e6ecf076c2f5802b30 Mon Sep 17 00:00:00 2001 From: lyncolnmd <59033979+lyncolnmd@users.noreply.github.com> Date: Sun, 1 Feb 2026 11:53:33 -0500 Subject: [PATCH] Enhance build workflow with version reading and multi-tagging --- .github/workflows/build.yml | 26 ++++++++++++++++++++++---- 1 file changed, 22 insertions(+), 4 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index ff268c0..dfa3fd2 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -17,6 +17,12 @@ jobs: - name: Checkout repository uses: actions/checkout@v4 + - name: Read version + id: version + run: | + VERSION=$(cat VERSION | tr -d ' \n') + echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Install Podman run: | sudo apt-get update @@ -28,13 +34,25 @@ jobs: -u ${{ github.actor }} \ --password-stdin - - name: Build image with Podman + - name: Build image with Podman (multi-tag) run: | + IMAGE=ghcr.io/${{ github.repository }} + VERSION=${{ steps.version.outputs.version }} + SHORT_SHA=${GITHUB_SHA::7} + podman build \ -f Containerfile \ - -t ghcr.io/${{ github.repository }}:latest \ + -t $IMAGE:latest \ + -t $IMAGE:v$VERSION \ + -t $IMAGE:sha-$SHORT_SHA \ . - - name: Push image to GHCR + - name: Push all tags run: | - podman push ghcr.io/${{ github.repository }}:latest + IMAGE=ghcr.io/${{ github.repository }} + VERSION=${{ steps.version.outputs.version }} + SHORT_SHA=${GITHUB_SHA::7} + + podman push $IMAGE:latest + podman push $IMAGE:v$VERSION + podman push $IMAGE:sha-$SHORT_SHA