Skip to content

kakao finish

kakao finish #23

Workflow file for this run

name: Frontend CI/CD
on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]
jobs:
build-and-deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Cache dependencies
uses: actions/cache@v4
with:
path: ~/.npm
key: ${{ runner.OS }}-node-${{ hashFiles('**/package-lock.json') }}-new-key
restore-keys: |
${{ runner.OS }}-node-
- name: Install dependencies
run: npm ci
continue-on-error: false
- name: Run tests
run: npm test -- --passWithNoTests
continue-on-error: false
- name: Build project
run: npm run build
env:
VITE_API_URL_MEMBER: ${{ secrets.API_URL_MEMBER }}
VITE_API_URL_PARTNER: ${{ secrets.API_URL_PARTNER }}
continue-on-error: false
- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v4
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ap-northeast-2
- name: Deploy to S3
run: |
aws s3 sync dist/ s3://${{ secrets.S3_BUCKET }} --delete
continue-on-error: false
- name: Invalidate CloudFront cache
run: |
aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --paths "/*"
continue-on-error: false