Skip to content

Commit

Permalink
Create main.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
jseo9732 authored Nov 5, 2023
1 parent d000c71 commit 7b20deb
Showing 1 changed file with 41 additions and 0 deletions.
41 changes: 41 additions & 0 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
name: CI

on:
push:
branches: [ "main" ]
pull_request:
branches: [ "main" ]

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout source code. # Repo checkout
uses: actions/checkout@v3

- name: Check Node v # Node v 확인
run: node -v

- name: Install Dependencies # 의존 파일 설치
run: yarn install --frozen-lockfile

- name: Setting .env
run: |
echo "NEXT_PUBLIC_GOOGLE_CLIENT_ID=${{ secrets.NEXT_PUBLIC_GOOGLE_CLIENT_ID }}" >> .env
- name: Build # React Build
run: yarn build

- name: Deploy
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_IAM_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_IAM_SECRET_ACCESS_KEY }}
run: |
aws s3 cp --recursive --region ${{ secrets.AWS_REGION }} out s3://${{ secrets.AWS_BUCKET_NAME }}
- name: CloudFront 캐시 무효화
env:
AWS_S3_BUCKET: ${{ secrets.AWS_BUCKET_NAME }}
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_IAM_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_IAM_SECRET_ACCESS_KEY }}
AWS_REGION: ${{ secrets.AWS_REGION }}
run: aws cloudfront create-invalidation --distribution-id ${{secrets.DEV_DISTRIBUTION_ID}} --paths "/*"

0 comments on commit 7b20deb

Please sign in to comment.