Skip to content

Commit

Permalink
Merge pull request #38 from IT-Cotato/seoyeon5117-patch-1
Browse files Browse the repository at this point in the history
[GITHUB ACTIONS] 배포 설정
  • Loading branch information
seoyeon5117 authored Feb 1, 2025
2 parents 45dc898 + 93df039 commit a2d01d0
Showing 1 changed file with 35 additions and 0 deletions.
35 changes: 35 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
name: Deploy

on:
push:
branches: ['develop']

jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Node
uses: actions/setup-node@v3
with:
node-version: 20
cache: 'npm'
- run: npm --force ci
- name: Build Production
run: CI=false npm run build --if-present

- name: Configure AWS Credentials
uses: aws-actions/configure-aws-credentials@v2
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
env:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: aws s3 sync --region ap-northeast-2 dist s3://kampus-bucket --delete

- name: Invalidate CloudFront Cache
run: aws cloudfront create-invalidation --distribution-id ${{secrets.AWS_DISTRIBUTION_ID}} --paths "/*"

0 comments on commit a2d01d0

Please sign in to comment.