Skip to content

Commit 68d1aaf

Browse files
chore: edit workflow add branch name []
1 parent 57e517e commit 68d1aaf

File tree

1 file changed

+13
-3
lines changed

1 file changed

+13
-3
lines changed

.github/workflows/sparrow-api-selfhost-publish.yml

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,11 @@ on:
33

44
workflow_dispatch:
55
inputs:
6+
branch:
7+
description: "Git branch to build"
8+
required: true
9+
default: release-v2
10+
type: string
611
image_version:
712
description: "Docker image version (e.g. 1.2.3)"
813
required: true
@@ -18,11 +23,15 @@ jobs:
1823

1924
env:
2025
DOCKER_IMAGE_VERSION: ${{ inputs.image_version }}
26+
BUILD_BRANCH: ${{ inputs.branch }}
27+
DOCKER_IMAGE_NAME: sparrowapi/sparrow-api
2128

2229
steps:
2330
- name: Checkout
2431
uses: actions/checkout@v4
25-
32+
with:
33+
ref: ${{ env.BUILD_BRANCH }}
34+
fetch-depth: 0
2635
- name: Set up QEMU
2736
uses: docker/setup-qemu-action@v3
2837

@@ -37,9 +46,10 @@ jobs:
3746

3847
- name: Build and push (multi-arch)
3948
run: |
49+
set -euo pipefail
4050
docker buildx build \
4151
--platform linux/amd64,linux/arm64 \
4252
--build-arg GITHUB_TOKEN=${{ secrets.SPARROW_GITHUB_TOKEN }} \
43-
-t sparrowapi/sparrow-api:${DOCKER_IMAGE_VERSION} \
44-
-t sparrowapi/sparrow-api:latest \
53+
-t $DOCKER_IMAGE_NAME:${DOCKER_IMAGE_VERSION} \
54+
-t $DOCKER_IMAGE_NAME:latest \
4555
--push .

0 commit comments

Comments
 (0)