Skip to content

Commit

Permalink
chore: Invalidate CloudFront cache 스크립트 추가 (#37)
Browse files Browse the repository at this point in the history
  • Loading branch information
silvertae committed Oct 25, 2023
1 parent e1ffd1f commit 2d1f927
Showing 1 changed file with 16 additions and 1 deletion.
17 changes: 16 additions & 1 deletion .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,22 +15,28 @@ jobs:
working-directory: ./fe

steps:
- uses: actions/checkout@v4
- name: Checkout
uses: actions/checkout@v4

- name: Use Node.js
uses: actions/setup-node@v3
with:
node-version: 18

- name: Create env file
run: |
touch .env
echo VITE_API_URL=${{ secrets.VITE_API_ENDPOINT }} >> .env
cat .env
- name: Npm Install
run: |
npm install
- name: Npm Build
run: |
npm run build
- name: Deploy to S3
uses: jakejarvis/s3-sync-action@master
with:
Expand All @@ -41,3 +47,12 @@ jobs:
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "ap-northeast-2"
SOURCE_DIR: "fe/dist"

- name: Invalidate CloudFront
uses: chetan/invalidate-cloudfront-action@v2
env:
DISTRIBUTION: ${{ secrets.AWS_DISTRIBUTION_ID }}
PATHS: "/index.html"
AWS_REGION: "ap-northeast-2"
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 comments on commit 2d1f927

Please sign in to comment.