-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #90 from delicious-algorithme/dev
CI/CD 수정
- Loading branch information
Showing
4 changed files
with
51 additions
and
58 deletions.
There are no files selected for viewing
This file was deleted.
Oops, something went wrong.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: Build & Deploy to AWS CloudFront | ||
|
||
on: | ||
push: | ||
branches: | ||
- main | ||
|
||
jobs: | ||
build-and-deploy: | ||
name: Build And Deploy | ||
runs-on: ubuntu-latest | ||
env: | ||
BUCKET: matal.store | ||
DIST: build | ||
REGION: ap-northeast-2 | ||
DIST_ID: E1EYXYPW1RLFM5 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v2 | ||
|
||
- name: Configure AWS credentials | ||
uses: aws-actions/configure-aws-credentials@v2 | ||
with: | ||
aws-access-key-id: ${{ secrets.AWS_FE_ACCESS_KEY_ID }} | ||
aws-secret-access-key: ${{ secrets.AWS_FE_SECRET_ACCESS_KEY }} | ||
aws-region: ${{env.REGION}} | ||
|
||
- name: Set up Node.js | ||
uses: actions/setup-node@v2 | ||
with: | ||
node-version: '21.1.0' | ||
|
||
- name: Install dependencies | ||
run: npm install | ||
|
||
- name: Build React app | ||
run: npm run build | ||
|
||
- name: Copy Build files to the production website with AWS CLI | ||
run: | | ||
aws s3 sync --delete ${{env.DIST}} s3://${{env.BUCKET}} | ||
- name: Clear Cache | ||
run: | | ||
aws cloudfront create-invalidation \ | ||
--distribution-id ${{env.DIST_ID}} \ | ||
--paths "/*" |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -8,6 +8,9 @@ | |
# testing | ||
/coverage | ||
|
||
# IntelliJ | ||
.idea | ||
|
||
# production | ||
/build | ||
|
||
|
This file was deleted.
Oops, something went wrong.