Update pr-preview.yml to add required permissions #97
Workflow file for this run
This file contains 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: Deploy PR previews to GitHub Pages | |
on: | |
pull_request: | |
types: | |
- opened | |
- reopened | |
- synchronize | |
- closed | |
concurrency: preview-${{ github.ref }} | |
permissions: | |
# Used by `pr-preview-action` to push pr preview build files to related branch | |
contents: write | |
# Used by `pr-preview-action` to leave a comment on the PR with the preview link | |
pull-requests: write | |
jobs: | |
deploy-preview: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout | |
uses: actions/checkout@v4 | |
- name: Setup Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 18 | |
- name: Install dependencies and build storybook | |
run: | | |
npm install | |
npm run storybook:build | |
- name: Deploy storybook build to GitHub Pages | |
uses: rossjrw/pr-preview-action@v1 | |
with: | |
source-dir: ./public/ |