From a73ad686ad7f976e4330f2db87d497e7dd0628cb Mon Sep 17 00:00:00 2001 From: Ercin Dedeoglu Date: Wed, 8 Nov 2023 20:09:55 +0400 Subject: [PATCH] . --- .github/workflows/publish-docker.yml | 18 +++++++++++++++--- .github/workflows/sync-whisper.yml | 8 -------- 2 files changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/publish-docker.yml b/.github/workflows/publish-docker.yml index 9ce4bc6..cf04947 100644 --- a/.github/workflows/publish-docker.yml +++ b/.github/workflows/publish-docker.yml @@ -33,6 +33,20 @@ jobs: - name: 🏷️ Extract Branch Name run: echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/})" >> $GITHUB_ENV + - name: 🏷️ Define Tags + id: set_tags + run: | + # Always set the default tags + TAGS="dublok/stt:${GITHUB_REF_NAME},dublok/stt:${GITHUB_REF_NAME}-${{ env.SHA_SHORT }}" + + # Check if GITHUB_REF_NAME starts with 'v' and if so, append '-latest' + if [[ $GITHUB_REF_NAME == v* ]]; then + TAGS="$TAGS,dublok/stt:${GITHUB_REF_NAME}-latest" + fi + + # Set the TAGS output for the next step + echo "::set-output name=tags::$TAGS" + - name: 🛠️ Build and Push Docker Images uses: docker/build-push-action@v5.0.0 with: @@ -40,6 +54,4 @@ jobs: file: ./src/Dockerfile push: true platforms: linux/amd64,linux/arm64,linux/s390x - tags: | - dublok/stt:${{ github.ref_name }} - dublok/stt:${{ github.ref_name }}-${{ env.SHA_SHORT }} + tags: ${{ steps.set_tags.outputs.tags }} diff --git a/.github/workflows/sync-whisper.yml b/.github/workflows/sync-whisper.yml index 078a0f3..05bfbc9 100644 --- a/.github/workflows/sync-whisper.yml +++ b/.github/workflows/sync-whisper.yml @@ -58,14 +58,6 @@ jobs: git add src/whisper git commit -m "Sync whisper.cpp to $tag 🚀" || echo "No changes to commit 🛑" git push origin $tag - - # If changes were committed and pushed, then create and push tag - if git show-ref --quiet --tags $tag; then - echo "Tag $tag already exists" - else - git tag $tag - git push origin $tag - fi env: PAT: ${{ secrets.PAT }}