Skip to content

chore: add storybook preview to pull requests #1

chore: add storybook preview to pull requests

chore: add storybook preview to pull requests #1

name: Build and Deploy
on:
pull_request:
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/[email protected]
with:
fetch-depth: 0
- name: Install and Build 🔧
run: |
npm install
npm run npm run build-storybook
- name: Deploy 🚀
uses: JamesIves/[email protected]
with:
branch: gh-pages
folder: storybook-static
clean: false
target-folder: preview/${{ github.sha }}
- name: Comment on Pull Request
uses: actions/github-script@v5
with:
github-token: ${{secrets.GITHUB_TOKEN}}
script: |
const subfolder = process.env.GITHUB_SHA;
github.rest.issues.createComment({
issue_number: context.issue.number,
owner: context.repo.owner,
repo: context.repo.repo,
body: [
'👋 Preview deployed to:',
'https://deriv-com.github.io/ui/preview/' + subfolder
].join('\n')
})