diff --git a/.github/workflows/dev-ci.yml b/.github/workflows/dev-ci.yml index c0f62f54..622df6d9 100644 --- a/.github/workflows/dev-ci.yml +++ b/.github/workflows/dev-ci.yml @@ -41,9 +41,6 @@ jobs: # src application 파일 생성 - name: make application-test.yml -# if: | -# contains(github.ref, 'main') || -# contains(github.ref, 'develop') run: | mkdir ./src/main/resources cd ./src/main/resources diff --git a/.github/workflows/dev-cd.yml b/.github/workflows/dev-cicd.yml similarity index 74% rename from .github/workflows/dev-cd.yml rename to .github/workflows/dev-cicd.yml index 01aebdcd..9df9dfab 100644 --- a/.github/workflows/dev-cd.yml +++ b/.github/workflows/dev-cicd.yml @@ -44,10 +44,7 @@ jobs: ${{ runner.os }}-gradle- # src application 파일 생성 - - name: make application-test.yml - # if: | - # contains(github.ref, 'main') || - # contains(github.ref, 'develop') + - name: make application.yml run: | mkdir ./src/main/resources cd ./src/main/resources @@ -71,13 +68,20 @@ jobs: - name: Build with Gradle run: ./gradlew build -# deploy_to_dev: -# needs: build-dev -# environment: dev -# runs-on: ubuntu-latest -# steps: -# - name: Checkout -# uses: actions/checkout@v3 + # jar 파일 upload + - name: Upload Jar file + uses: actions/upload-artifact@v3 + with: + name: jar-file + path: build/libs/*.jar + + deploy_to_dev: + needs: build-dev + environment: dev + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 - name: Configure AWS credentials uses: aws-actions/configure-aws-credentials@v1 @@ -90,6 +94,13 @@ jobs: id: login-ecr uses: aws-actions/amazon-ecr-login@v1 + # jar file download + - name: Download Jar file + uses: actions/download-artifact@v3 + with: + name: jar-file + path: build/libs/ + - name: Build, tag, and push image to Amazon ECR id: build-image env: @@ -117,4 +128,20 @@ jobs: task-definition: ${{ steps.task-def.outputs.task-definition }} service: ${{ env.ECS_SERVICE }} cluster: ${{ env.ECS_CLUSTER }} - wait-for-service-stability: true \ No newline at end of file + wait-for-service-stability: true + + slack_noti: + name: Slack_notification + runs-on: ubuntu-latest + needs: deploy-prod + steps: + - name: action-slack + uses: 8398a7/action-slack@v3 + with: + status: ${{ job.status }} + author_name: www-be + fields: repo,message,commit,author,action,eventName,ref,workflow,job,took + if_mention: failure,cancelled + env: + SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} # required + if: always() # Pick up events even if the job fails or is canceled. \ No newline at end of file