Skip to content

Commit 99d962e

Browse files
authored
rpurdel/build from branch (#68)
* feat: build from branch * feat: add custom docker tag, short sha
1 parent 5f9602e commit 99d962e

1 file changed

Lines changed: 25 additions & 3 deletions

File tree

.github/workflows/dh.yml

Lines changed: 25 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,15 @@ on:
55
- main
66
workflow_dispatch:
77
inputs:
8+
branch:
9+
description: Branch to build from
10+
type: string
11+
required: false
12+
default: "main"
13+
custom_tag:
14+
description: Custom tag to add (optional)
15+
type: string
16+
required: false
817
emsdk_version:
918
description: Emscripten SDK version, defaults to 4.0.20
1019
type: string
@@ -18,6 +27,7 @@ jobs:
1827
- name: Checkout
1928
uses: actions/checkout@v6
2029
with:
30+
ref: ${{ inputs.branch || github.ref }}
2131
submodules: 'true'
2232

2333
- name: Install Linux deps
@@ -68,13 +78,25 @@ jobs:
6878
- name: Set up Docker Buildx
6979
uses: docker/setup-buildx-action@v3
7080

81+
- name: Generate Docker tags
82+
id: meta
83+
run: |
84+
SHORT_SHA="${{ github.sha }}"
85+
SHORT_SHA="${SHORT_SHA:0:7}"
86+
TAGS="jitsi/opus-transcriber-proxy:${{ github.sha }},jitsi/opus-transcriber-proxy:$SHORT_SHA"
87+
if [ "${{ inputs.branch }}" = "main" ] || [ "${{ inputs.branch }}" = "" ]; then
88+
TAGS="$TAGS,jitsi/opus-transcriber-proxy:latest"
89+
fi
90+
if [ -n "${{ inputs.custom_tag }}" ]; then
91+
TAGS="$TAGS,jitsi/opus-transcriber-proxy:${{ inputs.custom_tag }}"
92+
fi
93+
echo "tags=$TAGS" >> $GITHUB_OUTPUT
94+
7195
- name: Build and push Docker image
7296
uses: docker/build-push-action@v6
7397
with:
7498
context: ./
7599
platforms: linux/amd64,linux/arm64
76100
pull: true
77101
push: true
78-
tags: |
79-
jitsi/opus-transcriber-proxy:latest
80-
jitsi/opus-transcriber-proxy:${{ github.sha }}
102+
tags: ${{ steps.meta.outputs.tags }}

0 commit comments

Comments
 (0)