Merge pull request #22 from Guzzing/feat/storybook #4
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: Deploy to S3 and Invalidate CloudFront | |
on: | |
push: | |
branches: | |
- main # 또는 배포할 브랜치 이름 | |
jobs: | |
build_and_deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v2 | |
- name: Set up Node.js | |
uses: actions/setup-node@v2 | |
with: | |
node-version: '14' | |
- name: Install dependencies and build | |
run: | | |
npm install | |
npm run build | |
- name: Deploy to S3 | |
uses: jakejarvis/[email protected] | |
with: | |
args: --acl public-read --follow-symlinks --delete | |
env: | |
AWS_S3_BUCKET: ${{ secrets.AWS_S3_BUCKET }} | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }} | |
AWS_REGION: 'ap-northeast-2' | |
SOURCE_DIR: 'dist' # React 빌드 결과물 디렉터리 | |
- name: Invalidate CloudFront | |
uses: chetan/[email protected] | |
env: | |
DISTRIBUTION: ${{ secrets.CLOUDFRONT_ID }} | |
PATHS: '/*' | |
AWS_REGION: 'ap-northeast-2' | |
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_S3_ACCESS_KEY_ID }} | |
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_S3_ACCESS_KEY }} |