From d7182be67a5b356078ca2c6d0ed9dab88e5c388a Mon Sep 17 00:00:00 2001 From: wcatz Date: Mon, 9 Mar 2026 14:14:31 -0400 Subject: [PATCH] ci: add workflow_dispatch to docker build for feature branch testing Adds manual trigger with custom tag input so feature branches can build multiarch images and push to Docker Hub without merging to master. --- .github/workflows/docker-build-push.yml | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/.github/workflows/docker-build-push.yml b/.github/workflows/docker-build-push.yml index b0d1326..4857b2e 100644 --- a/.github/workflows/docker-build-push.yml +++ b/.github/workflows/docker-build-push.yml @@ -9,6 +9,11 @@ on: pull_request: branches: - master + workflow_dispatch: + inputs: + tag: + description: 'Image tag (e.g. 3.1.0-rc1)' + required: true jobs: build-and-push: @@ -28,11 +33,12 @@ jobs: with: username: ${{ secrets.DOCKERHUB_USERNAME }} password: ${{ secrets.DOCKERHUB_TOKEN }} - if: github.event_name == 'push' + if: github.event_name != 'pull_request' - name: Extract tag for Docker image id: meta uses: docker/metadata-action@v5 + if: github.event_name != 'workflow_dispatch' with: images: wcatz/goduckbot flavor: | @@ -49,10 +55,10 @@ jobs: with: context: . platforms: linux/amd64,linux/arm64 - push: ${{ github.event_name == 'push' }} - tags: ${{ steps.meta.outputs.tags }} + push: ${{ github.event_name != 'pull_request' }} + tags: ${{ github.event_name == 'workflow_dispatch' && format('wcatz/goduckbot:{0}', inputs.tag) || steps.meta.outputs.tags }} labels: ${{ steps.meta.outputs.labels }} build-args: | - VERSION=${{ github.ref_name }} + VERSION=${{ github.event_name == 'workflow_dispatch' && inputs.tag || github.ref_name }} COMMIT_SHA=${{ github.sha }} BUILD_DATE=${{ github.event.head_commit.timestamp || github.event.pull_request.updated_at || github.event.repository.updated_at }} \ No newline at end of file