Skip to content

Commit

Permalink
fix: separate tag job
Browse files Browse the repository at this point in the history
  • Loading branch information
mischavandenburg committed Apr 30, 2024
1 parent ecb35d4 commit 1984966
Showing 1 changed file with 31 additions and 2 deletions.
33 changes: 31 additions & 2 deletions .github/workflows/build-docker-images.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,36 @@ on:
- "master"

jobs:
prepare_tag:
outputs:
tag: ${{ steps.semver.outputs.next }}
permissions:
contents: write

runs-on: ubuntu-latest

steps:
- name: Checkout
uses: actions/checkout@v4

# Defaults to patch version, will bump minor on "feat" commit

- name: Get Next Version
id: semver
uses: ietf-tools/semver-action@v1
with:
token: ${{ secrets.GITHUB_TOKEN }}
branch: master
patchAll: true

- name: Push tag
id: tag_version
uses: mathieudutour/[email protected]
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
custom_tag: ${{ steps.semver.outputs.next }}
tag_prefix: ""

docker:
permissions:
contents: write
Expand Down Expand Up @@ -51,7 +81,6 @@ jobs:
uses: docker/login-action@v3
with:
registry: ghcr.io
# username: ${{ github.repository_owner }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

Expand All @@ -61,7 +90,7 @@ jobs:
with:
context: ${{ matrix.path }}
platforms: linux/amd64
tags: ${{ matrix.image }}:${{ steps.semver.outputs.next }}
tags: ${{ matrix.image }}:${{ needs.prepare_tag.outputs.tag }}
file: ${{ matrix.dockerfile }}
push: true
# env:
Expand Down

0 comments on commit 1984966

Please sign in to comment.