Skip to content

Commit

Permalink
📦️ ci: storybook 배포 코드 작성
Browse files Browse the repository at this point in the history
  • Loading branch information
baegyeong committed Nov 14, 2024
1 parent 950adcc commit bb213a0
Showing 1 changed file with 58 additions and 0 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/storybook.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: storybook deploy

on:
push:
branches: ['dev-fe']

workflow_dispatch:

jobs:
deploy:
runs-on: ubuntu-latest
permissions:
contents: write
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true

steps:
- name: Use repository source
uses: actions/checkout@v3

- name: Use node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Cache node_modules
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
run: yarn ci
if: steps.cache.outputs.cache-hit != 'true'

- name: Set PUBLIC_URL
run: |
PUBLIC_URL=$(echo $GITHUB_REPOSITORY | sed -r 's/^.+\/(.+)$/\/\1\//')
echo PUBLIC_URL=$PUBLIC_URL > .env
- name: Build app
run: |
yarn run build
cp ./build/index.html ./build/404.html
- name: Build storybook
run: |
yarn run build-storybook
mv ./storybook-static ./build/storybook
- name: Deploy to gh-pages branch
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./build

0 comments on commit bb213a0

Please sign in to comment.