Skip to content

Create frontend-prod-cd.yml #17

Create frontend-prod-cd.yml

Create frontend-prod-cd.yml #17

name: ✨ Celuveat frontend CD ✨
on:
push:
branches:
- develop-frontend-cd-test*
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.16.1
- 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: |
echo "BASE_URL=$BASE_URL" >> .dev.env
echo "GOOGLE_MAP_API_KEY=$GOOGLE_MAP_API_KEY" >> .dev.env
echo "SHARE_KAKAO_LINK_KEY=$SHARE_KAKAO_LINK_KEY" >> .dev.env
env:
BASE_URL: ${{secrets.PROD_BASE_URL}}
GOOGLE_MAP_API_KEY: ${{secrets.GOOGLE_MAP_API_KEY}}
SHARE_KAKAO_LINK_KEY: ${{secrets.SHARE_KAKAO_LINK_KEY}}
- name: ✨ 의존성 설치
run: rm -rf ./node_modules yarn.lock && yarn cache clean && yarn install
- name: ✨ 빌드
run: yarn build:prod
deploy:
needs: build
runs-on: ubuntu-22.04
steps:
- uses: actions/checkout@master
- uses: awact/s3-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
SOURCE_DIR: './dist'
AWS_REGION: 'ap-northeast-2'
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}