Merge pull request #413 from GSM-MSG/hotfix/412-empty-authentication-… #77
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 Develop server | |
on: | |
push: | |
branches: | |
- develop | |
jobs: | |
CD: | |
name: CD | |
runs-on: ubuntu-latest | |
environment: production | |
steps: | |
- name: SMS-Backend-CD Discord Notification | |
uses: sarisia/actions-status-discord@v1 | |
if: ${{ success() }} | |
with: | |
title: ℹ️ SMS-Backend-Develop-CD 시작! ℹ️ | |
webhook: ${{ secrets.SMS_DISCORD_WEBHOOK }} | |
color: 00FF00 | |
- name: Checkout | |
uses: actions/checkout@v3 | |
- name: Set up JDK 11 | |
uses: actions/setup-java@v3 | |
with: | |
java-version: '11' | |
distribution: 'temurin' | |
cache: gradle | |
- name: Setup Gradle | |
uses: gradle/gradle-build-action@v2 | |
- name: Grant execute permission for gradlew | |
run: chmod +x gradlew | |
- name: Create application.yml | |
run: | | |
touch ./sms-infrastructure/src/main/resources/application.yml | |
echo "${{ secrets.SMS_BACKEND_DEV_ENV }}" > ./sms-infrastructure/src/main/resources/application.yml | |
shell: bash | |
- name: Run build with Gradle wrapper | |
run: ./gradlew clean build | |
- name: Configure AWS credentials | |
uses: aws-actions/configure-aws-credentials@v3 | |
with: | |
aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }} | |
aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }} | |
aws-region: ap-northeast-2 | |
- name: Login to Amazon ECR | |
id: login-ecr | |
uses: aws-actions/amazon-ecr-login@v1 | |
- name: Build, tag, and push image to Amazon ECR | |
id: build-image | |
env: | |
ECR_REGISTRY: ${{ steps.login-ecr.outputs.registry }} | |
run: | | |
docker build -t ${{ secrets.ECR_REPOSITORY }}:${{ secrets.DEVELOP_IMAGE_TAG }} . | |
docker tag ${{ secrets.ECR_REPOSITORY }}:${{ secrets.DEVELOP_IMAGE_TAG }} ${{ secrets.REPO_URL }}:${{ secrets.DEVELOP_IMAGE_TAG }} | |
docker push ${{ secrets.REPO_URL }}:${{ secrets.DEVELOP_IMAGE_TAG }} | |
# - name : CodeDeploy Create Deployment | |
# run: | | |
# aws deploy create-deployment \ | |
# --application-name codedeploy-develop-server \ | |
# --deployment-group-name codedeploy-group \ | |
# --deployment-config-name CodeDeployDefault.OneAtATime \ | |
# --github-location repository=${{ github.repository }},commitId=${{ github.sha }} | |
- name: SMS-Backend-CD Discord Notification | |
uses: sarisia/actions-status-discord@v1 | |
if: ${{ success() }} | |
with: | |
title: ✅ SMS-Backend-Develop-CD 성공! ✅ | |
webhook: ${{ secrets.SMS_DISCORD_WEBHOOK }} | |
status: ${{ job.status }} | |
image: ${{ secrets.CD_SUCCESS_IMAGE }} | |
description: 영역전개 CD 성공 | |
color: 00FF00 | |
username: SMS CD 봇 | |
url: https://github.com/GSM-MSG/SMS-BackEnd | |
- name: SMS-Backend-CD Discord Notification | |
uses: sarisia/actions-status-discord@v1 | |
if: ${{ failure() }} | |
with: | |
title: ❗️ SMS-Backend-Develop-CD 실패! ❗️ | |
webhook: ${{ secrets.SMS_DISCORD_WEBHOOK }} | |
status: ${{ job.status }} | |
image: ${{ secrets.CD_FAIL_IMAGE }} | |
description: 무례하긴, 실패다. | |
color: FF0000 | |
username: SMS CD 봇 | |
url: https://github.com/GSM-MSG/SMS-BackEnd |