Feature/storybook #2
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: Build and Publish Storybook to GitHub Pages | |
on: #main으로 push되면 실행 | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
permissions: | |
contents: read | |
pages: write | |
id-token: write | |
jobs: | |
build-storybook: | |
runs-on: ubuntu-latest | |
strategy: | |
matrix: | |
node-version: [14, 16, 18] | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v4 | |
- name: Set up Node.js | |
uses: actions/setup-node@v4 | |
with: | |
node-version: ${{ matrix.node-version }} | |
cache: 'yarn' | |
cache-dependency-path: yarn.lock | |
- name: Install dependencies | |
run: yarn install | |
- name: Build Storybook | |
run: yarn build-storybook | |
- name: Deploy Storybook to GitHub Pages | |
if: matrix.node-version == 18 | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_dir: ./storybook-static |