Skip to content

Update frontend-dev-cd.yml #69

Update frontend-dev-cd.yml

Update frontend-dev-cd.yml #69

Workflow file for this run

name: ✨ Celuveat frontend DEV CD ✨
on:
push:
branches:
- develop-frontend2*
jobs:
build:
runs-on: ubuntu-22.04
defaults:
run:
working-directory: ./frontend
concurrency:
group: ${{ github.workflow }}
cancel-in-progress: true
steps:
- name: ✨ Checkout repository
uses: actions/checkout@v3
- name: ✨ Node.js 설정
uses: actions/setup-node@v3
with:
node-version: 18.x
- name: ✨ Yarn global cache 캐싱
uses: actions/cache@v3
with:
path: '**/.yarn'
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: ✨ Yarn project cache 캐싱
uses: actions/cache@v3
with:
path: '~/.yarn/cache'
key: ${{ runner.os }}-yarn-project-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: ✨ 의존성 설치
run: yarn install --immutable
- name: ✨ 빌드
run: yarn build:dev
- name: ✨ artifact로 빌드파일 다운로드 가능하게 만들기
uses: actions/upload-artifact@v3
with:
name: dev-dist
path: frontend/dist
deploy:
needs: build
runs-on: [self-hosted, dev]
steps:
- name: ✨ 기존 폴더 삭제
working-directory: .
run: rm -rf dev
- name: ✨ artifact로부터 EC2에 빌드결과물 다운로드
uses: actions/download-artifact@v3
with:
name: dev-dist
path: dev/dist
- name: ✨ S3 업로드
run: |
aws s3 sync dev s3://2023-team-project/2023-celuveat/dev --delete