Enhance the splash screen's Analytics section. #27652
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| name: Storybook | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| - main | |
| # Only run if CSS/JS/MD-related files changed. | |
| paths: | |
| - '.github/workflows/storybook.yml' | |
| - 'assets/**' | |
| - '!assets/**/__tests__/**/*.js' | |
| - '!assets/**/test/*.js' | |
| - '!assets/**/*.test.js' | |
| - 'storybook/**' | |
| - '**.scss' | |
| - '.nvmrc' | |
| - '**/package.json' | |
| - 'package-lock.json' | |
| pull_request: | |
| branches: | |
| - develop | |
| - main | |
| - 'feature/**' | |
| # Only run if CSS/JS/MD-related files changed. | |
| paths: | |
| - '.github/workflows/storybook.yml' | |
| - 'assets/**' | |
| - '!assets/**/__tests__/**/*.js' | |
| - '!assets/**/test/*.js' | |
| - '!assets/**/*.test.js' | |
| - 'storybook/**' | |
| - '**.scss' | |
| - '.nvmrc' | |
| - '**/package.json' | |
| - 'package-lock.json' | |
| types: | |
| - opened | |
| - closed | |
| - reopened | |
| - synchronize | |
| - ready_for_review | |
| concurrency: | |
| group: storybook-${{ github.event_name }}-${{ github.ref }} | |
| cancel-in-progress: true | |
| jobs: | |
| build-storybook: | |
| name: Build Storybook | |
| runs-on: ubuntu-latest | |
| timeout-minutes: 20 | |
| if: | | |
| false == ( | |
| ( | |
| github.event_name == 'pull_request' && ( | |
| github.event.action == 'closed' || | |
| github.event.pull_request.draft == true || | |
| contains( github.head_ref, 'dependabot/' ) | |
| ) | |
| ) || | |
| github.event.pull_request.head.repo.fork | |
| ) | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Setup Node.js (.nvmrc) | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: npm install | |
| run: npm ci -w assets -w storybook -w tests/js --include-workspace-root | |
| - name: Build Storybook | |
| run: npm run build:storybook | |
| - name: Upload artifacts | |
| uses: actions/upload-artifact@v6 | |
| with: | |
| name: storybook-files | |
| path: dist | |
| deploy-storybook: | |
| name: Deploy Storybook | |
| runs-on: ubuntu-latest | |
| needs: build-storybook | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: storybook-files | |
| path: dist | |
| - name: Set branch environment variables | |
| id: branch-target | |
| if: github.event_name != 'pull_request' | |
| run: echo "dir=${GITHUB_REF##*/}" >> "$GITHUB_OUTPUT" | |
| - name: Set PR environment variables | |
| id: pr-target | |
| if: github.event_name == 'pull_request' | |
| env: | |
| PULL_REQUEST_NUMBER: ${{ github.event.number }} | |
| run: echo "dir=pull/${PULL_REQUEST_NUMBER}" >> "$GITHUB_OUTPUT" | |
| - uses: ./.github/actions/upload-to-gcs | |
| id: upload | |
| with: | |
| credentials-json: ${{ secrets.GCP_CREDENTIALS }} | |
| path: dist | |
| destination: storybook/${{ steps.branch-target.outputs.dir }}${{ steps.pr-target.outputs.dir }} | |
| - uses: ./.github/actions/update-pr-comment | |
| if: github.event_name == 'pull_request' | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| section-id: storybook | |
| section-content: | | |
| 📚 **Storybook for ${{ github.event.pull_request.head.sha }}:** | |
| - [View Storybook](${{ steps.upload.outputs.public-url }}/index.html) | |
| test-storybook: | |
| name: Test Storybook | |
| runs-on: ubuntu-latest | |
| needs: build-storybook | |
| timeout-minutes: 20 | |
| if: | | |
| false == ( | |
| ( | |
| github.event_name == 'pull_request' && ( | |
| github.event.action == 'closed' || | |
| github.event.pull_request.draft == true || | |
| contains( github.head_ref, 'dependabot/' ) | |
| ) | |
| ) || | |
| github.event.pull_request.head.repo.fork | |
| ) | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - name: Download artifacts | |
| uses: actions/download-artifact@v7 | |
| with: | |
| name: storybook-files | |
| path: dist | |
| - name: Setup Node.js (.nvmrc) | |
| uses: actions/setup-node@v6 | |
| with: | |
| node-version-file: .nvmrc | |
| cache: npm | |
| - name: npm install | |
| run: npm ci -w assets -w storybook -w tests/js --include-workspace-root | |
| - name: Test Storybook | |
| run: npm run test:storybook | |
| remove-storybook: | |
| name: Remove Storybook | |
| runs-on: ubuntu-latest | |
| if: github.event_name == 'pull_request' && github.event.action == 'closed' | |
| permissions: | |
| contents: read | |
| pull-requests: write | |
| steps: | |
| - uses: actions/checkout@v6 | |
| - uses: ./.github/actions/remove-gcs-path | |
| with: | |
| credentials-json: ${{ secrets.GCP_CREDENTIALS }} | |
| path: storybook/pull/${{ github.event.pull_request.number }} | |
| - uses: ./.github/actions/update-pr-comment | |
| with: | |
| issue-number: ${{ github.event.pull_request.number }} | |
| section-id: storybook | |
| section-content: | | |
| 📚 **Storybook for ${{ github.event.pull_request.head.sha }}:** | |
| - Storybook has been deleted. |