|
5 | 5 | - main |
6 | 6 | workflow_dispatch: |
7 | 7 | 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 |
8 | 17 | emsdk_version: |
9 | 18 | description: Emscripten SDK version, defaults to 4.0.20 |
10 | 19 | type: string |
|
18 | 27 | - name: Checkout |
19 | 28 | uses: actions/checkout@v6 |
20 | 29 | with: |
| 30 | + ref: ${{ inputs.branch || github.ref }} |
21 | 31 | submodules: 'true' |
22 | 32 |
|
23 | 33 | - name: Install Linux deps |
@@ -68,13 +78,25 @@ jobs: |
68 | 78 | - name: Set up Docker Buildx |
69 | 79 | uses: docker/setup-buildx-action@v3 |
70 | 80 |
|
| 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 | +
|
71 | 95 | - name: Build and push Docker image |
72 | 96 | uses: docker/build-push-action@v6 |
73 | 97 | with: |
74 | 98 | context: ./ |
75 | 99 | platforms: linux/amd64,linux/arm64 |
76 | 100 | pull: true |
77 | 101 | 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