From 9eec5a0321089c435667b4d5b8d0d16658879a64 Mon Sep 17 00:00:00 2001 From: Ashley Harrison Date: Wed, 14 Jan 2026 14:35:08 +0000 Subject: [PATCH] sort for latest as well --- .github/workflows/deploy-storybook.yml | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-storybook.yml b/.github/workflows/deploy-storybook.yml index 144689a46fe..fe683882379 100644 --- a/.github/workflows/deploy-storybook.yml +++ b/.github/workflows/deploy-storybook.yml @@ -1,10 +1,11 @@ name: Deploy Storybook on: - workflow_dispatch: push: branches: - main + release: + types: [released] concurrency: group: ${{ github.workflow }}-${{ github.ref }} @@ -61,11 +62,21 @@ jobs: run: yarn storybook:build # Create the GCS folder name - # Right now, this just returns "canary" - # But we'll expand this to work for "latest" as well in the future + # "latest" when triggered from the latest release + # "canary" on pushes to main - name: Create deploy name id: create-deploy-name run: | + if [[ "${{ github.event_name }}" == "release" ]]; then + LATEST_RELEASE_TAG=$(curl -s "https://api.github.com/repos/grafana/grafana/releases/latest" | jq -r '.tag_name') + if [[ "${{ github.event.release.tag_name }}" == "$LATEST_RELEASE_TAG" ]]; then + echo "deploy-name=latest" >> "$GITHUB_OUTPUT" + exit 0 + fi + echo "This is a release but not the latest release; skipping storybook deploy" + exit 1 + fi + echo "deploy-name=canary" >> "$GITHUB_OUTPUT" - name: Log in to GCS