Merge pull request #95 from GTable/feature/#58-docker-setting #59
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: Dev Admin CI/CD | |
| on: | |
| push: | |
| branches: | |
| - develop | |
| paths: | |
| - 'nowait-app-admin-api/**' | |
| - 'nowait-common/**' | |
| - 'nowait-domain/domain-core-rdb/**' | |
| - 'nowait-domain/domain-admin-rdb/**' | |
| - 'nowait-infra/**' | |
| - 'build.gradle' | |
| - 'settings.gradle' | |
| - 'gradle/**' | |
| env: | |
| PROJECT_NAME: NoWait | |
| DIVISION: admin | |
| AWS_REGION: ap-northeast-2 | |
| AWS_S3_BUCKET: nowait-deploy-github-actions | |
| AWS_CODE_DEPLOY_APPLICATION: nowaiting | |
| AWS_CODE_DEPLOY_GROUP: nowaiting-deploy-dev-admin | |
| jobs: | |
| build-with-gradle: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v3 | |
| - name: Set up JDK 17 | |
| uses: actions/setup-java@v3 | |
| with: | |
| java-version: '17' | |
| distribution: 'zulu' | |
| - name: Make gradlew executable | |
| run: chmod +x ./gradlew | |
| - name: Set YML | |
| run: | | |
| mkdir -p nowait-app-admin-api/src/main/resources | |
| echo "${{ secrets.APPLICATION_DEV_ADMIN_YML }}" \ | |
| | base64 --decode \ | |
| > nowait-app-admin-api/src/main/resources/application-admin.yml | |
| find nowait-app-admin-api/src | |
| - name: Build Admin JAR | |
| run: ./gradlew clean :nowait-app-admin-api:bootJar -x test | |
| - name: Prepare deployment package | |
| run: | | |
| rm -rf deploy | |
| mkdir -p deploy/scripts | |
| cp scripts/start-admin.sh scripts/stop-admin.sh deploy/scripts/ | |
| cp appspec-admin.yml deploy/appspec.yml | |
| cp nowait-app-admin-api/build/libs/nowait-app-admin-api-*.jar deploy/nowait-app-admin-api.jar | |
| cd deploy | |
| zip -r ../NoWait-admin-${GITHUB_SHA}.zip . | |
| cd .. | |
| - name: Configure AWS credentials | |
| uses: aws-actions/configure-aws-credentials@v1 | |
| with: | |
| aws-region: ${{ env.AWS_REGION }} | |
| aws-access-key-id: ${{ secrets.DEVSERVER_CICD_ACCESS_KEY }} | |
| aws-secret-access-key: ${{ secrets.DEVSERVER_CICD_SECRET_KEY }} | |
| - name: Upload to S3 | |
| run: | | |
| aws deploy push \ | |
| --application-name "${{ env.AWS_CODE_DEPLOY_APPLICATION }}" \ | |
| --ignore-hidden-files \ | |
| --s3-location "s3://${{ env.AWS_S3_BUCKET }}/${{ env.PROJECT_NAME }}/${{ env.DIVISION }}/${{ github.sha }}.zip" \ | |
| --source deploy | |
| - name: Create CodeDeploy deployment | |
| run: | | |
| aws deploy create-deployment \ | |
| --application-name ${{ env.AWS_CODE_DEPLOY_APPLICATION }} \ | |
| --deployment-config-name CodeDeployDefault.AllAtOnce \ | |
| --deployment-group-name ${{ env.AWS_CODE_DEPLOY_GROUP }} \ | |
| --s3-location bucket=${{ env.AWS_S3_BUCKET }},key=${{ env.PROJECT_NAME }}/${{ env.DIVISION }}/${{ github.sha }}.zip,bundleType=zip |