Skip to content

Commit

Permalink
Fix: Add version-specific Docker tags
Browse files Browse the repository at this point in the history
Implemented extraction of major, minor, and patch versions from tags. Updated the build-and-push step to push these specific version tags to the GitHub Container Registry.
  • Loading branch information
Christian Roessner committed Sep 16, 2024
1 parent 39bfb95 commit e6d9127
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions .github/workflows/docker-stable.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -24,6 +24,17 @@ jobs:
username: ${{ github.repository_owner }}
password: ${{ secrets.GHCR_TOKEN }}

- name: Extract tag versions
id: extract_version
run: |
tag=${GITHUB_REF##*/} # gets the tag name, e.g., v1.2.3
major=$(echo $tag | cut -d'.' -f1)
minor=$(echo $tag | cut -d'.' -f2)
patch=$(echo $tag | cut -d'.' -f3)
echo "major=${major}" >> $GITHUB_ENV
echo "minor=${minor}" >> $GITHUB_ENV
echo "patch=${patch}" >> $GITHUB_ENV
- name: Build and push
uses: docker/build-push-action@v5
with:
Expand All @@ -33,4 +44,7 @@ jobs:
push: true
tags: |
ghcr.io/${{ github.repository_owner }}/geoip-policyd:latest
ghcr.io/${{ github.repository_owner }}/geoip-policyd:${{ env.major }}
ghcr.io/${{ github.repository_owner }}/geoip-policyd:${{ env.major }}.${{ env.minor }}
ghcr.io/${{ github.repository_owner }}/geoip-policyd:${{ env.major }}.${{ env.minor }}.${{ env.patch }}
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Policy server that blocks senders based on country and IP diversity

0 comments on commit e6d9127

Please sign in to comment.