Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add: up/down load artifact file #79

Merged
merged 1 commit into from
Oct 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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.