Skip to content

Commit

Permalink
Merge pull request #79 from KATJ-HH2/feature/lil/addCiCdJob
Browse files Browse the repository at this point in the history
add: up/down load artifact file
  • Loading branch information
JangHyeonJun2 authored Oct 1, 2023
2 parents 6101f0e + b7c17ec commit b38631c
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 15 deletions.
3 changes: 0 additions & 3 deletions .github/workflows/dev-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
51 changes: 39 additions & 12 deletions .github/workflows/dev-cd.yml → .github/workflows/dev-cicd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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
Expand All @@ -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:
Expand Down Expand Up @@ -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
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.

0 comments on commit b38631c

Please sign in to comment.