diff --git a/.github/workflows/build-docker-images.yaml b/.github/workflows/build-docker-images.yaml index f16bb2eb..4f803eca 100644 --- a/.github/workflows/build-docker-images.yaml +++ b/.github/workflows/build-docker-images.yaml @@ -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/github-tag-action@v6.2 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + custom_tag: ${{ steps.semver.outputs.next }} + tag_prefix: "" + docker: permissions: contents: write @@ -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 }} @@ -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: