From ae68ee43db6ded1804ab639f9bfa131d28e0a934 Mon Sep 17 00:00:00 2001 From: Serubin Date: Fri, 22 Mar 2024 01:02:11 -0400 Subject: [PATCH] Use a calver action for tagging --- .github/workflows/build.yaml | 19 ++++++++++++++++--- 1 file changed, 16 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build.yaml b/.github/workflows/build.yaml index 9197c6d..ac86623 100644 --- a/.github/workflows/build.yaml +++ b/.github/workflows/build.yaml @@ -2,7 +2,6 @@ name: Build and Publish Docker Image on: push: branches: ["master"] - tags: ["*"] env: REGISTRY: ghcr.io @@ -28,14 +27,28 @@ jobs: username: ${{ github.actor }} password: ${{ secrets.GITHUB_TOKEN }} + - name: Get next version + uses: reecetech/version-increment@2023.9.3 + id: version + with: + scheme: calver + increment: patch + + - name: Create tag + uses: rickstaa/action-create-tag@v1 + id: "tag_create" + with: + tag: ${{ steps.version.outputs.version }} + tag_exists_error: false + message: "v${{ steps.version.outputs.version }}" + - name: Extract metadata to create tags and labels id: meta uses: docker/metadata-action@v5.5.1 with: images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} tags: | - type=semver,pattern={{version}} - type=semver,pattern={{version}},value={{date 'YY.M.D' tz='America/New_York'}},enabled={{is_default_branch}} + type=raw,value=${{steps.version.outputs.version}},priority=300 type=raw,value=latest,enable={{is_default_branch}} - name: Build and push Docker image