Skip to content

refactor: 마컀 λ Œλ”λ§ 방식을 κ°œμ„ ν•œλ‹€ #678

refactor: 마컀 λ Œλ”λ§ 방식을 κ°œμ„ ν•œλ‹€

refactor: 마컀 λ Œλ”λ§ 방식을 κ°œμ„ ν•œλ‹€ #678

name: storybook-deploy
on:
pull_request:
branches:
- develop
paths:
- frontend/**
- .github/**
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./frontend
steps:
- name: Setup Repository
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 18.16.0
- name: Install dependencies
run: npm install
- 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: storybook build
run: npm run build-storybook
- name: Upload storybook build files to temp artifact
uses: actions/upload-artifact@v3
with:
name: Storybook
path: frontend/storybook-static
deploy:
needs: build
runs-on: self-hosted
steps:
- name: Remove previous version app
working-directory: .
run: rm -rf dist
- name: Download the built file to AWS
uses: actions/download-artifact@v3
with:
name: Storybook
path: frontend/dev/dist
- name: Move folder
working-directory: frontend/dev/
run: |
rm -rf /home/ubuntu/dist/*
cp -r ./dist /home/ubuntu