Merge : 다크모드 구현 #19
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Frontend Deploy # action 명 | |
on: # 이벤트 트리거 | |
push: # push event에 반응 | |
paths: | |
- "client/**" # client의 변경이 있을 때 | |
branches: # github repository의 branch가 | |
- master # master 일 경우만 | |
jobs: | |
deploy: # GitHub-hosted runners env | |
runs-on: macos-latest # using MacOS | |
defaults: | |
run: | |
working-directory: "client" # client 폴더에서 실행 | |
steps: | |
- uses: actions/checkout@v3 | |
- name: Set Node.js 18.x | |
uses: actions/setup-node@v3 | |
with: | |
node-version: 18.x | |
- name: Install dependencies | |
run: npm install | |
- name: Build page | |
run: npm run build | |
- name: Sync Bucket | |
env: | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
AWS_EC2_METADATA_DISABLED: true | |
run: | | |
aws s3 sync \ | |
--region ap-northeast-2 \ | |
build s3://sheepdog13.blog \ | |
--delete | |
- name: CloudFront 캐시 무력화 코드 | |
uses: chetan/invalidate-cloudfront-action@v2 | |
env: | |
DISTRIBUTION: ${{ secrets.AWS_CLOUDFRONT_ID}} | |
PATHS: "/*" | |
AWS_REGION: ${{ secrets.AWS_REGION }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }} |