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
This commit is contained in:
parent
80d32461d8
commit
b91dbf167c
1 changed files with 57 additions and 0 deletions
57
.github/workflows/publish-branch-image.yml
vendored
Normal file
57
.github/workflows/publish-branch-image.yml
vendored
Normal file
|
|
@ -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 }}
|
||||||
|
|
||||||
Loading…
Reference in a new issue