Skip to content

Commit

Permalink
Use a calver action for tagging
Browse files Browse the repository at this point in the history
  • Loading branch information
Serubin committed Mar 22, 2024
1 parent 936a9ab commit ae68ee4
Showing 1 changed file with 16 additions and 3 deletions.
19 changes: 16 additions & 3 deletions .github/workflows/build.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@ name: Build and Publish Docker Image
on:
push:
branches: ["master"]
tags: ["*"]

env:
REGISTRY: ghcr.io
Expand All @@ -28,14 +27,28 @@ jobs:
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Get next version
uses: reecetech/[email protected]
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/[email protected]
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
Expand Down

0 comments on commit ae68ee4

Please sign in to comment.