chore: update GitHub Actions workflow for automated versioning and release management
- Replace manual version detection with GitHub Tag Action - Implement automatic version bumping and tagging - Add GitHub Release creation with changelog generation - Simplify Docker image tagging using new version workflow
This commit is contained in:
27
.github/workflows/docker-build-push.yml
vendored
27
.github/workflows/docker-build-push.yml
vendored
@@ -23,21 +23,21 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
fetch-depth: 0 # Required for version detection
|
fetch-depth: 0 # Required for version detection
|
||||||
|
|
||||||
- name: Get version from tag
|
- name: Bump version and push tag
|
||||||
id: version
|
id: tag_version
|
||||||
uses: actions/github-script@v6
|
uses: mathieudutour/github-tag-action@v6.1
|
||||||
with:
|
|
||||||
script: |
|
|
||||||
const tag = process.env.GITHUB_REF?.replace('refs/tags/v', '');
|
|
||||||
return tag || 'latest';
|
|
||||||
|
|
||||||
- name: Set up semantic versioning
|
|
||||||
id: semver
|
|
||||||
uses: mathieudutour/github-tag-action@v6
|
|
||||||
with:
|
with:
|
||||||
github_token: ${{ secrets.GITHUB_TOKEN }}
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
||||||
default_bump: patch
|
default_bump: patch
|
||||||
tag_prefix: 'v'
|
|
||||||
|
- name: Create Release
|
||||||
|
uses: actions/create-release@v1
|
||||||
|
env:
|
||||||
|
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
with:
|
||||||
|
tag_name: ${{ steps.tag_version.outputs.new_tag }}
|
||||||
|
release_name: Release ${{ steps.tag_version.outputs.new_tag }}
|
||||||
|
body: ${{ steps.tag_version.outputs.changelog }}
|
||||||
|
|
||||||
- name: Log in to the Container registry
|
- name: Log in to the Container registry
|
||||||
uses: docker/login-action@v2
|
uses: docker/login-action@v2
|
||||||
@@ -52,8 +52,7 @@ jobs:
|
|||||||
with:
|
with:
|
||||||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
|
||||||
tags: |
|
tags: |
|
||||||
type=raw,value=${{ steps.version.outputs.result }}
|
type=raw,value=${{ steps.tag_version.outputs.new_tag }}
|
||||||
type=raw,value=${{ steps.semver.outputs.new_tag }}
|
|
||||||
type=raw,value=latest
|
type=raw,value=latest
|
||||||
|
|
||||||
- name: Build and push Docker image
|
- name: Build and push Docker image
|
||||||
|
|||||||
Reference in New Issue
Block a user