Skip to content

Commit

Permalink
deploy.yml
Browse files Browse the repository at this point in the history
  • Loading branch information
eunxoo committed Feb 14, 2024
1 parent 52aa5c5 commit 34c77e6
Showing 1 changed file with 48 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
name: Deploy # Workflow 이름
on: # Event 감지
push:
branches:
- main # 해당 브랜치의 푸쉬가 일어날 때 CI/CD를 진행하겠다는 뜻
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout source code. # Repo checkout
uses: actions/checkout@v2

- name: Check Node v # Node v 확인
run: node -v

- name: Install Dependencies # 의존 파일 설치
run: yarn install --frozen-lockfile

- name: Build # React Build
run: yarn build
env:
CI: ""

- name: zip create
# zip 파일을 만듭니다(파일명은 자유, 대신 아래 workflow에 적을 파일명과 동일하게 맞춰주세요).
run: zip -qq -r ./mutsa-deploy.zip .
shell: bash

- name: Configure AWS credentials
uses: aws-actions/configure-aws-credentials@v1
with:
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
aws-region: ${{ secrets.AWS_REGION }}

- name: Upload to S3 # Upload build file to S3
env:
AWS_ACCESS_KEY_ID: ${{ secrets.AWS_ACCESS_KEY_ID }}
AWS_SECRET_ACCESS_KEY: ${{ secrets.AWS_SECRET_ACCESS_KEY }}
run: |
aws s3 cp --region ap-northeast-2 ./mutsa-deploy.zip s3://mutsa-github-actions/mutsa-deploy.zip
- name: Deploy # Deploy to EC2
run: aws deploy create-deployment
--application-name codeDeploy-mutsa-app
--deployment-config-name CodeDeployDefault.AllAtOnce
--deployment-group-name mutsa-deploy-group
--s3-location bucket=mutsa-github-actions,key=mutsa-deploy.zip,bundleType=zip

0 comments on commit 34c77e6

Please sign in to comment.