diff --git a/.github/workflows/build_and_publish.yml b/.github/workflows/build_and_publish.yml index da77992..ff78b69 100644 --- a/.github/workflows/build_and_publish.yml +++ b/.github/workflows/build_and_publish.yml @@ -15,6 +15,9 @@ on: publish: required: true type: boolean + update_latest: + required: true + type: boolean jobs: build: @@ -35,6 +38,14 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Configure target tags (with latest) + if: ${{ inputs.update_latest }} + run: echo "TAGS=mumblevoip/mumble-server:latest, mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV + + - name: Configure target tags (without latest) + if: ${{ ! inputs.update_latest }} + run: echo "TAGS=mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }}" >> $GITHUB_ENV - name: Build and push uses: docker/build-push-action@v2 @@ -44,6 +55,6 @@ jobs: push: ${{ inputs.publish }} build-args: | MUMBLE_VERSION=${{ inputs.mumble_version }} - tags: mumblevoip/mumble-server:latest, mumblevoip/mumble-server:${{ inputs.mumble_version }}, mumblevoip/mumble-server:${{ inputs.mumble_version }}-${{ inputs.docker_version }} + tags: ${{ env.TAGS }} env: MUMBLE_VERSION: ${{ inputs.mumble_version }} diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 2ba044e..cbc5c2e 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -11,6 +11,7 @@ jobs: mumble_version: "v1.4.230" docker_version: '0' publish: false + update_latest: false platforms: "linux/amd64" build_latest: uses: ./.github/workflows/build_and_publish.yml @@ -18,4 +19,5 @@ jobs: mumble_version: "latest" docker_version: '0' publish: false + update_latest: true platforms: "linux/amd64" diff --git a/.github/workflows/manual_dispatch.yml b/.github/workflows/manual_dispatch.yml index 567c34d..b7cced3 100644 --- a/.github/workflows/manual_dispatch.yml +++ b/.github/workflows/manual_dispatch.yml @@ -15,6 +15,10 @@ on: description: "Whether the built image(s) shall be published to Dockerhub" required: true default: "false" + update_latest: + description: "Whether to update the 'latest' tag on Dockerhub" + required: true + default: "false" jobs: manual_dispatch: @@ -23,5 +27,6 @@ jobs: mumble_version: ${{ github.event.inputs.mumble_version }} docker_version: ${{ github.event.inputs.docker_version }} publish: ${{ github.event.inputs.publish == 'true' }} + update_latest: ${{ github.event.inputs.update_latest == 'true' }} platforms: "linux/amd64" secrets: inherit