refactor: 배치 처리 최대 허용 시간 정의 및 Busy Counter 상태 유지 주기 동기화 (#224) #60
This file contains hidden or 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" ] | |
| pull_request: | |
| branches: [ "develop" ] | |
| env: | |
| AWS_REGION: ${{ secrets.AWS_REGION }} | |
| S3_BUCKET_NAME: ${{ secrets.DEPLOY_S3_BUCKET_NAME }} | |
| CODE_DEPLOY_APPLICATION_NAME: trainus-codedeploy-app | |
| CODE_DEPLOY_DEPLOYMENT_GROUP_NAME: trainus-deploy-group | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up JDK 21 | |
| uses: actions/setup-java@v4 | |
| with: | |
| java-version: '21' | |
| distribution: 'temurin' | |
| - name: Grant execute permission for gradlew | |
| run: chmod +x gradlew | |
| - name: Build with Gradle | |
| run: ./gradlew build -x test | |
| - name: Configure AWS credentials | |
| if: github.event_name == 'push' | |
| uses: aws-actions/configure-aws-credentials@v4 | |
| 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 | |
| if: github.event_name == 'push' | |
| run: | | |
| zip -r deploy.zip . | |
| aws s3 cp deploy.zip s3://$S3_BUCKET_NAME/deploy.zip | |
| - name: CodeDeploy Deploy | |
| if: github.event_name == 'push' | |
| run: | | |
| aws deploy create-deployment \ | |
| --application-name $CODE_DEPLOY_APPLICATION_NAME \ | |
| --deployment-config-name CodeDeployDefault.OneAtATime \ | |
| --deployment-group-name $CODE_DEPLOY_DEPLOYMENT_GROUP_NAME \ | |
| --s3-location bucket=$S3_BUCKET_NAME,bundleType=zip,key=deploy.zip |