Skip to content

feb-dain의 스토리북 배포 #28

feb-dain의 스토리북 배포

feb-dain의 스토리북 배포 #28

Workflow file for this run

name: Storybook Deployment
run-name: ${{ github.actor }}의 스토리북 배포
on:
pull_request:
branches:
- develop
jobs:
deploy:
runs-on: ubuntu-latest
permissions: write-all
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
strategy:
matrix:
node-version: [18.x]
steps:
- name: Use repository source
uses: actions/checkout@v3
- name: Setup Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v3
with:
node-version: ${{ matrix.node-version }}
- name: Cache dependencies
id: cache
uses: actions/cache@v3
with:
path: '**/node_modules'
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-
- name: Install Dependencies
if: steps.cache.outputs.cache-hit != 'true'
run: npm ci
- name: Set PUBLIC_URL
run: |
PUBLIC_URL=$(echo $GITHUB_REPOSITORY | sed -r 's/^.+\/(.+)$/\/\1\//')
echo PUBLIC_URL=$PUBLIC_URL > .env
- name: Build App
run: npm run build
- name: Build Storybook
run: |
npm run build-storybook
mv ./storybook-static ./dist/storybook
- name: Deploy To 'gh-pages' Branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./dist
- name: comment PR
uses: thollander/actions-comment-pull-request@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
message: '🚀storybook: https://car-ffeine.github.io/react-without-cra/storybook'