diff --git a/.github/workflows/github-workflow.yaml b/.github/workflows/github-workflow.yaml index 76bf706..f029de0 100644 --- a/.github/workflows/github-workflow.yaml +++ b/.github/workflows/github-workflow.yaml @@ -8,6 +8,8 @@ on: branches: - master - dev + tags: + - "*.*.*" jobs: coverage: @@ -78,6 +80,21 @@ jobs: permissions: packages: write steps: + - name: Docker meta + id: meta + uses: docker/metadata-action@v5 + with: + # list of Docker images to use as base name for tags + images: | + micha37-martins/smartmon + ghcr.io/micha37-martins/smartmon + # generate Docker tags based on the following events/attributes + tags: | + type=ref,event=branch + type=semver,pattern={{version}} + type=semver,pattern={{major}}.{{minor}} + type=semver,pattern={{major}} + type=sha - name: Checkout code uses: actions/checkout@v3.6.0 @@ -95,11 +112,9 @@ jobs: password: ${{ secrets.GITHUB_TOKEN }} - name: Build and push Docker container - uses: docker/build-push-action@v4 + uses: docker/build-push-action@v6 with: context: . platforms: linux/amd64,linux/arm64 push: true - tags: | - ghcr.io/${{ github.repository_owner }}/smartmon:latest - ghcr.io/${{ github.repository_owner }}/smartmon:${{ steps.latest_tag.outputs.tag }} + tags: ${{ steps.meta.outputs.tags }}