Skip to content

Commit

Permalink
fix(ci): push minor version tags
Browse files Browse the repository at this point in the history
Besides pushing patch versions for docker image tags (like 0.1.2), also push a minor version series tag (0.1.x). Makes it safer for automatic upgrades.
  • Loading branch information
l4rm4nd authored Jul 19, 2024
1 parent 0607a6a commit c1661da
Showing 1 changed file with 10 additions and 2 deletions.
12 changes: 10 additions & 2 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -62,8 +62,15 @@ jobs:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}

- name: Extract version parts
id: extract_version
run: |
VERSION=${{ needs.changelog.outputs.version }}
MAJOR_MINOR=$(echo $VERSION | cut -d'.' -f1,2)
echo "MAJOR_MINOR_TAG=${MAJOR_MINOR}.x" >> $GITHUB_ENV
- name: Setup Docker Metadata
uses: docker/metadata-action@dbef88086f6cef02e264edb7dbf63250c17cef6c # v5
uses: docker/metadata-action@v5
id: meta
with:
images: |
Expand All @@ -72,6 +79,7 @@ jobs:
latest
${{ needs.changelog.outputs.version }}
${{ github.sha }}
${{ env.MAJOR_MINOR_TAG }}
- name: Build and Push Docker Image
uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5
Expand Down Expand Up @@ -109,4 +117,4 @@ jobs:
<summary>🤖 Autogenerated Conventional Changelog</summary>
${{ needs.changelog.outputs.clean_changelog }}
</details>
</details>

0 comments on commit c1661da

Please sign in to comment.