diff --git a/.circleci/config.yml b/.circleci/config.yml index d59802e7506..8369cd4d383 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -411,6 +411,40 @@ jobs: command: ./scripts/ci-job-succeeded.sh when: on_success + publish-storybook: + description: "Publish Storybook" + executor: grafana-publish + steps: + - checkout + - run: + name: CI job started + command: ./scripts/ci-job-started.sh + - run: + name: Publish Storybook + command: | + echo $GCP_GRAFANA_UPLOAD_KEY > /tmp/gcpkey.json + gcloud auth activate-service-account --key-file=/tmp/gcpkey.json + yarn install --frozen-lockfile --no-progress + yarn storybook:build + if [[ $CIRCLE_BRANCH == "chore/test-release-pipeline" ]]; then + # We're testing the release pipeline + echo Testing release + elif [[ $CIRCLE_BRANCH == "master" ]]; then + gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/latest + elif [[ -n $CIRCLE_TAG ]]; then + gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/$CIRCLE_TAG + else + gsutil -m rsync -d -r ./packages/grafana-ui/dist/storybook gs://grafana-storybook/${CIRCLE_SHA1:0:7} + fi + - run: + name: CI job failed + command: ./scripts/ci-job-failed.sh + when: on_fail + - run: + name: CI job succeeded + command: ./scripts/ci-job-succeeded.sh + when: on_success + build-docker-images: description: "Build Docker images" parameters: @@ -1019,6 +1053,7 @@ workflows: - build-enterprise-windows-installer - end-to-end-tests - build-release-publisher + - publish-storybook - build-docker-images: # No filters, meaning this job runs for all branches name: build-oss-docker-images