Skip to content

upgrade github action #24

upgrade github action

upgrade github action #24

Workflow file for this run

name: Deploy To Develop
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 20
- name: Cache node modules
uses: actions/cache@v4
with:
path: node_modules
key: ${{ runner.OS }}-build-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.OS }}-build-
${{ runner.OS }}-
- name: Install Dependencies
run: npm install
- name: Build
env:
VITE_KAKAO_MAP_API_KEY: ${{ secrets.REACT_APP_KAKAO_MAP_API_KEY }}
VITE_SUPABASE_URL: https://izhutepzzveasglrlbcx.supabase.co
VITE_SUPABASE_KEY: eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJzdXBhYmFzZSIsInJlZiI6Iml6aHV0ZXB6enZlYXNnbHJsYmN4Iiwicm9sZSI6ImFub24iLCJpYXQiOjE3Mjc5NTkyMzgsImV4cCI6MjA0MzUzNTIzOH0.kxdrs6OI-fD2QXsdmqZJx_Knm_gwDEXFYqgte46akEw
VITE_API_ERROR_HELPER_HOST: ${{ secrets.REACT_APP_API_ERROR_HELPER_HOST }}
VITE_GOOGLE_CLIENT_ID: ${{ secrets.VITE_GOOGLE_CLIENT_ID }}
run: npm run build
- name: Reinstall without Dev Dependencies
run: rm -rf node_modules && npm ci --only=production --ignore-scripts
- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_BUCKET: ${{ secrets.DEV_AWS_BUCKET }}
run: |
aws s3 cp \
--recursive \
--region ap-northeast-2 \
dist s3://$AWS_BUCKET
- name: Cloudfront Invalidation
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_DEFAULT_REGION: ap-northeast-2
DISTRIBUTION_ID: ${{ secrets.DEV_CLOUDFRONT_DISTRIBUTION_ID }}
run: |
aws cloudfront create-invalidation \
--distribution-id $DISTRIBUTION_ID \
--paths "/*"