Skip to content

Switched trigger for PRs to pull_request_target. #58

Switched trigger for PRs to pull_request_target.

Switched trigger for PRs to pull_request_target. #58

name: Publish Storybook to GitHub Pages
on:
push:
branches:
- 'main'
# WARNING: This allows storybook-branch-switcher CLI to run `npm run ${arbitrary_script}`
# BUT the worst it can do is force changes to our GitHub Pages website,
# unless the permissions key below is changed.
pull_request_target:
types: [opened, synchronize, reopened]
# Be careful about changing these, due to pull_request_target trigger.
permissions:
contents: read
pages: write
id-token: write
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
submodules: true
# See: https://github.com/bitovi/github-actions-storybook-to-github-pages
- uses: bitovi/[email protected]
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
build_command: "npx sb-branch-switcher --config .storybook/.branches.json"
path: dist/storybook-bundle
# Done manually so we can checkout submodule
checkout: false