App Health Check #110
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# μ ν리μΌμ΄μ μλ²μ νΉμ URLλ‘ μμ²μ 보λ΄μ΄ λμ μνλ₯Ό νμΈνλ μν¬νλ‘μ λλ€. | |
# 맀 0λΆμ κΈ°μ€μΌλ‘ μλμΌλ‘ λμνλ©°, μ΄μμ΄ μμ κ²½μ° κ΄λ¦¬μμ μ¬λμΌλ‘ μλ¦Όμ μ μ‘ν©λλ€. | |
name: App Health Check | |
on: | |
schedule: | |
- cron: '0 * * * *' | |
jobs: | |
healthcheck: | |
runs-on: ubuntu-latest | |
steps: | |
# νμ¬ μκ° μ»κΈ° | |
- name: Get current time | |
uses: josStorer/[email protected] | |
id: current-datetime | |
with: | |
format: YYYY-MM-DDTHH:mm:ss | |
utcOffset: "+09:00" | |
# μλ² μ¨λΌμΈ μν νμΈ | |
- name: Check Server Online | |
uses: Jtalk/url-health-check-action@v4 | |
with: | |
url: ${{ secrets.SERVER_URL }} | |
max-attempts: 3 | |
retry-delay: 10s | |
# μ¬λ λ©μμ§ μ μ‘ (μ±κ³΅) | |
- name: Send Slack Message on Success | |
if: success() | |
uses: 8398a7/[email protected] | |
with: | |
status: success | |
text: | | |
β *μλ² ν¬μ€ μ²΄ν¬ μ±κ³΅* | |
μλ²μ API μμ²μ μλνμμΌλ©°, μ μμ μΌλ‘ λμνλ κ²μΌλ‘ νμΈλ©λλ€. | |
μμ μΌμ: ${{ steps.current-datetime.outputs.formattedTime }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} | |
# μ¬λ λ©μμ§ μ μ‘ (μ€ν¨) | |
- name: Send Slack Message on Failure | |
if: failure() | |
uses: 8398a7/[email protected] | |
with: | |
status: failure | |
text: | | |
π¨ *μλ² ν¬μ€ μ²΄ν¬ μ€ν¨* | |
μλ²μ API μμ²μ 3ν μλνμμΌλ, μ¬λ°λ₯΄κ² λμνμ§ μμ΅λλ€. | |
κ΄λ¦¬μλκ»μλ μμΈμ νμ νμ¬ μ μ ν μ‘°μΉλ₯Ό μ·¨ν΄μ£ΌμΈμ. | |
μμ μΌμ: ${{ steps.current-datetime.outputs.formattedTime }} | |
env: | |
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }} |