diff --git a/.github/workflows/build-providers.yaml b/.github/workflows/build-providers.yaml index 148ae149..871a7e52 100644 --- a/.github/workflows/build-providers.yaml +++ b/.github/workflows/build-providers.yaml @@ -9,6 +9,8 @@ on: push: branches: - main + tags: + - "v*" jobs: providers-build: @@ -37,21 +39,20 @@ jobs: target: providers platforms: linux/amd64,linux/arm64 tags: | - ghcr.io/obot-platform/tools/providers:latest + ${{ github.ref_type == 'tag' && format('ghcr.io/obot-platform/tools/providers:{0}', github.ref_name) || 'ghcr.io/obot-platform/tools/providers:latest' }} - name: Install Cosign uses: sigstore/cosign-installer@v3.8.1 with: - cosign-release: 'v2.4.3' + cosign-release: "v2.4.3" - name: Sign Images env: DIGEST: ${{ steps.build-and-push.outputs.digest }} - TAGS: ghcr.io/obot-platform/tools/providers:latest + TAGS: ${{ github.ref_type == 'tag' && format('ghcr.io/obot-platform/tools/providers:{0}', github.ref_name) || 'ghcr.io/obot-platform/tools/providers:latest' }} run: | images="" for tag in ${TAGS}; do images+="${tag}@${DIGEST} " done cosign sign --yes ${images} - diff --git a/.github/workflows/build-tools.yaml b/.github/workflows/build-tools.yaml index 80596e41..f11b8033 100644 --- a/.github/workflows/build-tools.yaml +++ b/.github/workflows/build-tools.yaml @@ -9,6 +9,8 @@ on: push: branches: - main + tags: + - "v*" jobs: oss-tools-build: @@ -37,17 +39,17 @@ jobs: target: tools platforms: linux/amd64,linux/arm64 tags: | - ghcr.io/${{ github.repository }}:latest + ${{ github.ref_type == 'tag' && format('ghcr.io/obot-platform/tools/tools:{0}', github.ref_name) || 'ghcr.io/${{ github.repository }}:latest' }} - name: Install Cosign uses: sigstore/cosign-installer@v3.8.1 with: - cosign-release: 'v2.4.3' + cosign-release: "v2.4.3" - name: Sign Images env: DIGEST: ${{ steps.build-and-push.outputs.digest }} - TAGS: ghcr.io/${{ github.repository }}:latest + TAGS: ${{ github.ref_type == 'tag' && format('ghcr.io/obot-platform/tools/tools:{0}', github.ref_name) || 'ghcr.io/${{ github.repository }}:latest' }} run: | images="" for tag in ${TAGS}; do