.github/workflows/healthCheck.yml #3
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
name: "[운영] 헬스체크" | |
on: | |
workflow_dispatch: | |
# on: | |
# schedule: | |
# - cron: "0 0 */3 * *" | |
jobs: | |
healthcheck: | |
runs-on: ubuntu-latest | |
steps: | |
- name: API Health Check | |
id: health_check | |
uses: jtalk/url-health-check-action@v3 | |
with: | |
url: ${{ secrets.BASE_URI_PROD }} | |
max-attempts: 3 | |
retry-delay: 1s | |
- name: Set status message | |
id: set_message | |
run: | | |
if [ "${{ steps.health_check.outputs.conclusion }}" == "OKSuccess" ]; then | |
echo "::set-output name=message::Health check succeeded" | |
else | |
echo "::set-output name=message::Health check failed" | |
fi | |
- name: Discord Webhook Action | |
if: always() | |
uses: tsickert/[email protected] | |
with: | |
webhook-url: ${{ secrets.WEBHOOK_URL }} | |
content: ${{ steps.set_message.outputs.message }} |