Skip to content

Commit

Permalink
fix: 전용 workflow으로 수정.
Browse files Browse the repository at this point in the history
  • Loading branch information
tronze committed Dec 11, 2024
1 parent c0a84a6 commit 33a130b
Showing 1 changed file with 21 additions and 9 deletions.
30 changes: 21 additions & 9 deletions .github/workflows/front-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,27 @@ on:
push:
branches: ["dev"]

env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
AWS_REGION: "ap-northest-2"

jobs:
deploy:
uses: tronze/useful-workflows/.github/workflows/s3-cloudfront-deploy.yml@main
with:
NODE_VERSION: v18.13.0
S3_BUCKET_NAME: ${{ secrets.S3_BUCKET_NAME }}
CLOUDFRONT_DISTRIBUTION_ID: ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }}
AWS_REGION: ${{ secrets.AWS_REGION }}
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Setup Environment
uses: actions/setup-node@master
with:
node-version: v18.13.0
- name: Setup Project
run: yarn
- name: Build Project
run: yarn build
- name: Upload to S3
run: aws s3 sync dist s3://${{ secrets.S3_BUCKET_NAME }} --delete
- name: Invalidate Cloudfront
run: aws cloudfront create-invalidation --distribution-id ${{ secrets.CLOUDFRONT_DISTRIBUTION_ID }} --path "/*"
BUILD_COMMAND: yarn build
secrets:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

0 comments on commit 33a130b

Please sign in to comment.