Skip to content

Merge branch 'bugfix/dh' #49

Merge branch 'bugfix/dh'

Merge branch 'bugfix/dh' #49

Workflow file for this run

name: FEDeploy2aws 🛸
on:
push:
branches:
- main
pull_request:
branches:
- main
types:
- closed
jobs:
deploy:
# if: github.event.pull_request.merged == true
environment: dev
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
# Node.js 설정
- name: Set up Node.js
uses: actions/setup-node@v3
with:
node-version: '20' # 프로젝트에 맞는 Node.js 버전을 사용하세요.
# 의존성 설치
- name: Install dependencies
run: npm install
# 빌드 스크립트 실행
- name: Build
run: npm run build
# AWS 인증 (IAM 사용자 Access Key, Secret Key 활용)
- 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: ${{ vars.AWS_REGION }}
# 빌드 결과물을 S3 버킷에 업로드
- name: Upload to AWS S3
run: |
aws deploy push \
--application-name ${{ vars.CODE_DEPLOY_APP_NAME }} \
--ignore-hidden-files \
--s3-location s3://${{ vars.S3_BUCKET_NAME }}/$GITHUB_SHA.zip \
--source .
# S3 버킷에 있는 파일을 대상으로 CodeDeploy 실행
- name: Deploy to AWS EC2 from S3
run: |
aws deploy create-deployment \
--application-name ${{ vars.CODE_DEPLOY_APP_NAME }} \
--deployment-config-name CodeDeployDefault.AllAtOnce \
--deployment-group-name ${{ vars.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} \
--s3-location bucket=${{ vars.S3_BUCKET_NAME }},key=$GITHUB_SHA.zip,bundleType=zip