From b91dbf167cdc812bebcf7749caa0081dbda259ea Mon Sep 17 00:00:00 2001 From: KennyG Date: Wed, 1 Apr 2026 12:15:49 -0400 Subject: [PATCH] Add workflow_dispatch branch image publish workflow. Introduce a dedicated GHCR branch publish workflow so feature branches can produce deployable test tags via CI, matching the hasharr branch-image flow. Made-with: Cursor --- .github/workflows/publish-branch-image.yml | 57 ++++++++++++++++++++++ 1 file changed, 57 insertions(+) create mode 100644 .github/workflows/publish-branch-image.yml diff --git a/.github/workflows/publish-branch-image.yml b/.github/workflows/publish-branch-image.yml new file mode 100644 index 0000000..fe64dbb --- /dev/null +++ b/.github/workflows/publish-branch-image.yml @@ -0,0 +1,57 @@ +name: publish-branch-image + +on: + workflow_dispatch: + inputs: + image_tag: + description: "Container tag to publish" + required: true + default: "hash-mt-integration" + +permissions: + contents: read + packages: write + +jobs: + publish-ghcr-branch: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v6 + + - name: Prepare image name + id: image + run: echo "name=$(echo "ghcr.io/${GITHUB_REPOSITORY}" | tr '[:upper:]' '[:lower:]')" >> "$GITHUB_OUTPUT" + + - name: Compute publish tag + id: tag + run: | + TAG="${{ github.event.inputs.image_tag }}" + TAG="$(echo "$TAG" | tr '[:upper:]' '[:lower:]')" + echo "value=$TAG" >> "$GITHUB_OUTPUT" + + - name: Set up QEMU + uses: docker/setup-qemu-action@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v4 + + - name: Login to GHCR + uses: docker/login-action@v4 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + + - name: Publish image + uses: docker/build-push-action@v7 + with: + context: . + platforms: linux/amd64,linux/arm64 + push: true + build-args: | + VERSION=${{ github.run_number }} + tags: | + ${{ steps.image.outputs.name }}:${{ steps.tag.outputs.value }} + ${{ steps.image.outputs.name }}:${{ github.sha }} +