Skip to content

Commit 0816802

Browse files
committed
🎨 Use wget for health check
1 parent 193ade6 commit 0816802

2 files changed

Lines changed: 38 additions & 10 deletions

File tree

.github/workflows/build-and-deploy-prometheus.yml

Lines changed: 37 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -67,12 +67,40 @@ jobs:
6767
wait-for-service-stability: true
6868
wait-for-minutes: 8
6969

70-
- name: Deployment notification
71-
if: always()
72-
run: |
73-
if [ "${{ job.status }}" == "success" ]; then
74-
echo "✅ Deployment successful!"
75-
else
76-
echo "❌ Deployment failed!"
77-
exit 1
78-
fi
70+
- name: Send Success Message
71+
if: success()
72+
uses: Ilshidur/action-discord@0.3.2
73+
with:
74+
args: "새로운 버전이 배포되었어요 🚀"
75+
env:
76+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
77+
DISCORD_EMBEDS: |
78+
[
79+
{
80+
"author": {
81+
"name": "${{ github.event.pull_request.user.login }}"
82+
},
83+
"title": "Deployment Successed",
84+
"description": "Workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
85+
"color": 10478271
86+
}
87+
]
88+
89+
- name: Send Failure Message
90+
if: failure()
91+
uses: Ilshidur/action-discord@0.3.2
92+
with:
93+
args: "배포가 실패했어요 😢"
94+
env:
95+
DISCORD_WEBHOOK: ${{ secrets.DISCORD_WEBHOOK }}
96+
DISCORD_EMBEDS: |
97+
[
98+
{
99+
"author": {
100+
"name": "${{ github.event.pull_request.user.login }}"
101+
},
102+
"title": "Deployment Failed",
103+
"description": "Workflow: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}",
104+
"color": 13458524
105+
}
106+
]

prometheus/Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,4 +5,4 @@ COPY prometheus.yml /etc/prometheus/prometheus.yml
55
EXPOSE 9090
66

77
HEALTHCHECK --interval=15s --timeout=3s --start-period=10s --retries=3 \
8-
CMD ["curl", "-f", "http://localhost:9090/-/healthy"]
8+
CMD ["wget", "--quiet", "--output-document=-", "http://localhost:9090/-/healthy"]

0 commit comments

Comments
 (0)