Skip to content

Commit

Permalink
Merge pull request #89 from delicious-algorithme/88-fix/github-action…
Browse files Browse the repository at this point in the history
…s-workflows-cicd

CI/CD 파이프라인 설계 변경
  • Loading branch information
Songhyejeong authored Nov 19, 2024
2 parents fe786ce + 6fa1267 commit dc9e6e6
Show file tree
Hide file tree
Showing 4 changed files with 51 additions and 58 deletions.
48 changes: 0 additions & 48 deletions .github/workflows/deploy.yml

This file was deleted.

48 changes: 48 additions & 0 deletions .github/workflows/matal-fe-cicd.yml
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 "/*"
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,9 @@
# testing
/coverage

# IntelliJ
.idea

# production
/build

Expand Down
10 changes: 0 additions & 10 deletions appspec.yml

This file was deleted.

0 comments on commit dc9e6e6

Please sign in to comment.