chore: (#165) build 폴더에서 dist 폴더로 변경 #5
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 | |
on: | |
push: | |
branches: ['feat/#165'] | |
paths: | |
- 'frontend/**' | |
- '.github/**' | |
defaults: | |
run: | |
working-directory: frontend | |
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: npm 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: | | |
npm run build | |
cp ./dist/index.html ./dist/404.html | |
- name: Build storybook | |
run: | | |
npm run build-storybook | |
mv ./storybook-static ./dist/storybook | |
- name: storybook-deploy 브런치에 배포할 파일을 업데이트 한다. | |
uses: peaceiris/actions-gh-pages@v3 | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
publish_branch: storybook-deploy | |
publish_dir: ./dist |