일괄 채점 후 완료로 진행 상황 변경 #27
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
name: Deploy to Amazon EC2 | |
on: | |
push: | |
branches: | |
- develop | |
env: | |
S3_BUCKET_NAME: moaroom-frontend-codedeploy | |
CODE_DEPLOY_APPLICATION_NAME: moaroom-frontend | |
CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: moaroom-frontend-dg | |
permissions: | |
contents: read | |
jobs: | |
build: | |
name: Build | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: Checkout source code. # Repo checkout | |
uses: actions/checkout@v2 | |
- name: Check Node v # Node v 확인 | |
run: node -v | |
- name: Install Dependencies # 의존 파일 설치 | |
run: npm install | |
- name: Build # React Build | |
run: npm run build | |
- name: zip create | |
run: zip -qq -r ./build-fe.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 AWS S3 | |
run: | | |
aws s3 cp --region ${{ secrets.AWS_REGION }} ./build-fe.zip s3://$S3_BUCKET_NAME/build-fe.zip | |
- name: Deploy to AWS EC2 from S3 | |
run: aws deploy create-deployment | |
--application-name ${{ env.CODE_DEPLOY_APPLICATION_NAME }} | |
--deployment-config-name CodeDeployDefault.AllAtOnce | |
--deployment-group-name ${{ env.CODE_DEPLOY_DEPLOYMENT_GROUP_NAME }} | |
--s3-location bucket=$S3_BUCKET_NAME,key=build-fe.zip,bundleType=zip |