Skip to content

Commit

Permalink
πŸ’š CI λΉŒλ“œ μˆ˜μ • : PR 생성 μ‹œ CI μžλ™ μ‹€ν–‰ 버그 해결에 κ΄€ν•œ μ„€μ • λ‚΄μš© μΆ”κ°€ μˆ˜μ •
Browse files Browse the repository at this point in the history
- PR 생성 μ‹œ CI κ°€ μžλ™μœΌλ‘œ μ‹€ν–‰λ˜λŠ” 버그 μˆ˜μ •μ— κ΄€λ ¨λœ 파일 λ‚΄μš© μΆ”κ°€

Ref : #35
  • Loading branch information
rowing0328 authored Nov 4, 2024
1 parent 338eb1b commit 785ff71
Showing 1 changed file with 42 additions and 2 deletions.
44 changes: 42 additions & 2 deletions .github/workflows/gradle-build-deploy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,6 @@ jobs:
run: |
mkdir -p ./src/test/resources/properties
echo "${{ secrets.TEST_ENV_FILE }}" > ./src/test/resources/properties/test-env.properties
- name: Setup Gradle
uses: gradle/actions/setup-gradle@af1da67850ed9a4cedd57bfd976089dd991e2582 # v4.0.0

Expand All @@ -53,4 +52,45 @@ jobs:
push: true
tags: |
${{ secrets.DOCKER_USERNAME }}/jdk-21-spring-boot-3.3.1:${{ github.sha }}
${{ secrets.DOCKER_USERNAME }}/
${{ secrets.DOCKER_USERNAME }}/jdk-21-spring-boot-3.3.1:latest
- name: SSH to Remote Server and Deploy
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.REMOTE_HOST }}
username: ${{ secrets.SSH_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
port: ${{ secrets.SSH_PORT }}
script: |
docker-compose -f /home/ubuntu/itzip/docker-compose.yml down
docker-compose -f /home/ubuntu/itzip/docker-compose.yml pull
docker-compose -f /home/ubuntu/itzip/docker-compose.yml up -d
docker system prune -a -f
- name: Send Success Discord Notification
if: success()
run: |
curl -H "Content-Type: application/json" \
-d '{"content": "**배포 성곡!** :rocket: \nλΉŒλ“œ 및 배포 과정이 μ„±κ³΅μ μœΌλ‘œ μ™„λ£Œλ˜μ—ˆμŠ΅λ‹ˆλ‹€."}' \
${{ secrets.DISCORD_WEBHOOK_URL }}
- name: Send Failure Discord Notification
if: failure()
run: |
outcome_message=""
if [ "${{ steps.build.outcome }}" == "failure" ]; then
outcome_message+="λΉŒλ“œ λ‹¨κ³„μ—μ„œ 였λ₯˜ λ°œμƒ. "
fi
if [ "${{ steps.docker_build.outcome }}" == "failure" ]; then
outcome_message+="Docker λΉŒλ“œ λ‹¨κ³„μ—μ„œ 였λ₯˜ λ°œμƒ. "
fi
if [ "${{ steps.deploy.outcome }}" == "failure" ]; then
outcome_message+="배포 λ‹¨κ³„μ—μ„œ 였λ₯˜ λ°œμƒ. "
fi
curl -H "Content-Type: application/json" \
-d '{"content": "**배포 μ‹€νŒ¨!** :x: \nλΉŒλ“œ 및 배포 κ³Όμ •μ—μ„œ 였λ₯˜κ°€ λ°œμƒν–ˆμŠ΅λ‹ˆλ‹€. \n였λ₯˜ λ‚΄μš©: '"${outcome_message}"'"}' \
${{ secrets.DISCORD_WEBHOOK_URL }}

0 comments on commit 785ff71

Please sign in to comment.