Skip to content

Commit

Permalink
ci: change container versioning
Browse files Browse the repository at this point in the history
  • Loading branch information
mnb3000 committed Mar 19, 2024
1 parent 4d29739 commit 488a537
Showing 1 changed file with 20 additions and 5 deletions.
25 changes: 20 additions & 5 deletions .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,8 @@ permissions:
jobs:
release-on-push:
runs-on: ubuntu-latest
outputs:
tag_name: ${{ steps.release.outputs.tag_name }}
permissions:
contents: write
env:
Expand All @@ -27,12 +29,25 @@ jobs:
runs-on: ubuntu-latest
needs: release-on-push
steps:
- name: Checkout Code
uses: actions/checkout@v3
with:
fetch-depth: 0

- name: Get previous tag
id: previousTag
run: |
name=$(git --no-pager tag --sort=creatordate --merged ${{ github.ref_name }} | tail -2 | head -1)
echo "previousTag: $name"
echo "previousTag=$name" >> $GITHUB_ENV
- name: Update CHANGELOG
id: changelog
uses: requarks/changelog-action@v1
with:
token: ${{ github.token }}
tag: ${{ needs.jobs.release-on-push.steps.release.outputs.tag_name }}
fromTag: ${{ needs.jobs.release-on-push.outputs.tag_name }}
toTag: ${{ env.previousTag }}

- name: Commit CHANGELOG.md
uses: stefanzweifel/git-auto-commit-action@v4
Expand Down Expand Up @@ -81,9 +96,9 @@ jobs:
flavor: |
latest=auto
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=semver,pattern={{major}}
type=semver,pattern={{version}},version=${{ needs.jobs.release-on-push.steps.outputs.tag_name }}
type=semver,pattern={{major}}.{{minor}},version=${{ needs.jobs.release-on-push.steps.outputs.tag_name }}
type=semver,pattern={{major}},version=${{ needs.jobs.release-on-push.steps.outputs.tag_name }}
type=ref,event=branch
- name: Build and push
Expand All @@ -95,4 +110,4 @@ jobs:
targets: default
push: true
env:
RELEASE: ${{ needs.jobs.release-on-push.steps.release.outputs.tag_name }}
RELEASE: ${{ needs.jobs.release-on-push.steps.outputs.tag_name }}

0 comments on commit 488a537

Please sign in to comment.