diff --git a/.gitea/workflows/cd.yaml b/.gitea/workflows/cd.yaml index 0c0bd7a..e56dd1c 100644 --- a/.gitea/workflows/cd.yaml +++ b/.gitea/workflows/cd.yaml @@ -11,6 +11,7 @@ on: - "config.example.yaml" - "Dockerfile" - "Makefile" + workflow_dispatch: env: DOCKER_REGISTRY: gitea.t000-n.de @@ -87,10 +88,32 @@ jobs: tags: | ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-${{ matrix.arch }} + create_tag: + name: Create tag + runs-on: ubuntu-latest + outputs: + tag: ${{ steps.tag.outputs.new-tag }} + steps: + - uses: actions/checkout@8e8c483db84b4bee98b60c0593521ed34d9990e8 # v6 + with: + fetch-depth: 0 + - uses: https://gitea.t000-n.de/t.behrendt/conventional-semantic-git-tag-increment@0.1.20 + id: tag + with: + token: ${{ secrets.GITEA_TOKEN }} + prerelease: ${{ github.event_name == 'workflow_dispatch' }} + - run: | + git tag ${{ steps.tag.outputs.new-tag }} + git push origin ${{ steps.tag.outputs.new-tag }} + - name: Set output + run: | + echo "tag=${{ steps.tag.outputs.new-tag }}" >> $GITHUB_OUTPUT + create_manifest: name: Create manifest needs: - build_and_push + - create_tag runs-on: ubuntu-latest steps: - name: Checkout @@ -111,8 +134,8 @@ jobs: - name: Create manifest run: | - docker manifest create ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:latest \ + docker manifest create ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ needs.create_tag.outputs.tag }} \ ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-amd64 \ ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ steps.meta.outputs.REPO_VERSION }}-arm64 - docker manifest push ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:latest + docker manifest push ${{ env.DOCKER_REGISTRY }}/t.behrendt/${{ steps.meta.outputs.REPO_NAME }}:${{ needs.create_tag.outputs.tag }}