Skip to content

Commit

Permalink
Merge branch 'feature/cicd' into develop
Browse files Browse the repository at this point in the history
  • Loading branch information
Hyeonsu Kim committed Jan 22, 2025
2 parents c41efab + d708bda commit ba2d495
Showing 1 changed file with 17 additions and 26 deletions.
43 changes: 17 additions & 26 deletions .github/workflows/main-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,75 +9,66 @@ on: # 이벤트 트리거
jobs: # jobs
build: # GitHub-hosted runners env
runs-on: ubuntu-latest
permissions:
id-token: write
contents: read
steps: # steps
- name: git clone #
uses: actions/checkout@v2 #
uses: actions/checkout@v3 #

- name: AWS Credentials Production
uses: aws-actions/configure-aws-credentials@v4
with:
role-to-assume: arn:aws:iam::597559577496:role/integration-shared-RoleForGitBuild
aws-region: ap-northeast-2

- name: npm install #
run: npm run dependency # npm install
run: npm run dependency #npm install

- name: build #
run: npm run build # code build

- name: Deploy Production # 운영 배포
if: github.ref == 'refs/heads/main'
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
run: |
aws sts get-caller-identity
aws s3 cp \
--recursive \
--region ap-northeast-2 \
docs/dist s3://prd.inticons.com
- name: CF Invalidation Production # 운영 배포
if: github.ref == 'refs/heads/main'
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
run: |
aws sts get-caller-identity
aws cloudfront create-invalidation --distribution-id E2DYHQTJ062JGM --paths "/*"
- name: Deploy Staging # 스테이징 배포
if: github.ref == 'refs/heads/develop'
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
run: |
aws sts get-caller-identity
aws s3 cp \
--recursive \
--region ap-northeast-2 \
docs/dist s3://stg.inticons.com
- name: CF Invalidation Staging # 스테이징 배포
if: github.ref == 'refs/heads/develop'
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
run: |
aws sts get-caller-identity
aws cloudfront create-invalidation --distribution-id E5U62C7XQEO1I --paths "/*"
- name: Deploy Dev # 개발 배포
if: github.ref == 'refs/heads/develop'
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
run: |
aws sts get-caller-identity
aws s3 cp \
--recursive \
--region ap-northeast-2 \
docs/dist s3://dev.inticons.com
- name: CF Invalidation Deploy Dev # 개발 배포
if: github.ref == 'refs/heads/develop'
env:
AWS_ACCESS_KEY_ID: '${{ secrets.AWS_ACCESS_KEY_ID }}'
AWS_REGION: '${{ secrets.AWS_REGION }}'
AWS_SECRET_ACCESS_KEY: '${{ secrets.AWS_SECRET_ACCESS_KEY }}'
run: |
aws sts get-caller-identity
aws cloudfront create-invalidation --distribution-id E27M30HZJ0NM49 --paths "/*"

0 comments on commit ba2d495

Please sign in to comment.