Skip to content

analystic UI๊ตฌํ˜„ (#57) #16

analystic UI๊ตฌํ˜„ (#57)

analystic UI๊ตฌํ˜„ (#57) #16

Workflow file for this run

name: Deploy React App to S3
on:
push:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
steps:
# 1. ์ฝ”๋“œ ์ฒดํฌ์•„์›ƒ
- name: Checkout code
uses: actions/checkout@v3
# 2. Node.js ์„ค์น˜
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version: '18'
# 3. ์˜์กด์„ฑ ์„ค์น˜ (npm install)
- name: Install dependencies
run: npm install
# 4. React ์•ฑ ๋นŒ๋“œ
- name: Build React app
run: |
echo "VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }}" >> .env
echo "VITE_USE_MSW=${{ secrets.VITE_USE_MSW }}" >> .env
echo "VITE_KAKAO_MAP_KEY=${{ secrets.VITE_KAKAO_MAP_KEY }}" >> .env
npm run build
# 5. AWS S3๋กœ ํŒŒ์ผ ์—…๋กœ๋“œ
- name: Deploy to S3
uses: awact/s3-action@master
with:
args: --acl public-read --follow-symlinks --delete
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: 'ap-northeast-2'
AWS_S3_BUCKET: ${{ secrets.S3_BUCKET_NAME }}
SOURCE_DIR: './dist' # ๋นŒ๋“œ๋œ React ์•ฑ์ด ์žˆ๋Š” ๋””๋ ‰ํ„ฐ๋ฆฌ