Release/15.0.0 #492
Workflow file for this run
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: Build Storybook PR | |
on: | |
pull_request: | |
jobs: | |
build-storybook: | |
name: Build Storybook PR | |
permissions: | |
pull-requests: write | |
contents: read | |
id-token: write | |
runs-on: ubuntu-latest | |
defaults: | |
run: | |
working-directory: apps/storybook-react | |
steps: | |
- name: Checkout and setup environment | |
uses: MetaMask/action-checkout-and-setup@v1 | |
with: | |
is-high-risk-environment: false | |
skip-allow-scripts: true | |
- name: Build required packages | |
working-directory: . | |
run: yarn build | |
- name: Build storybook | |
run: yarn build-storybook | |
- name: Upload 'storybook-build' to S3 | |
if: ${{ vars.AWS_REGION && vars.AWS_IAM_ROLE && vars.AWS_S3_BUCKET }} | |
uses: metamask/github-tools/.github/actions/upload-s3@1233659b3850eb84824d7375e2e0c58eb237701d | |
with: | |
aws-region: ${{ vars.AWS_REGION }} | |
role-to-assume: ${{ vars.AWS_IAM_ROLE }} | |
s3-bucket: ${{ vars.AWS_S3_BUCKET }}/${{ github.event.repository.name }}/${{ github.run_id }}/storybook-build | |
path: apps/storybook-react/storybook-static | |
- name: Post Preview Comment | |
working-directory: . | |
if: ${{ vars.AWS_CLOUDFRONT_URL }} | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
PR_NUMBER: ${{ github.event.pull_request.number }} | |
HOST_URL: ${{ vars.AWS_CLOUDFRONT_URL }}/${{ github.event.repository.name }}/${{ github.run_id }} | |
run: | | |
gh pr comment "${PR_NUMBER}" --body "### 📖 Storybook Preview | |
- [View PR Storybook](${HOST_URL}/storybook-build/index.html)" |