Files
grafana_alerts/.gitea/workflows/main.yml
kyy ba99c722c6
All checks were successful
Run Report Table / run-script (push) Successful in 25s
스크립트 줄 바꿈 형식
2025-09-05 13:43:31 +09:00

51 lines
1.3 KiB
YAML

# .gitea/workflows/main.yml
name: Run Report Table
on:
schedule:
- cron: "45 4 * * *"
jobs:
run-script:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Fix line endings and permissions
shell: bash
run: |
set -euo pipefail
sed -i 's/\r$//' run_table.sh
chmod +x run_table.sh
echo "[OK] Prepared run_table.sh"
- name: Set up Python
uses: actions/setup-python@v5
with:
python-version: "3.x"
- name: Install dependencies
run: pip install -r requirements.txt
- name: Run script
shell: bash
env:
GRAFANA_URL: ${{ vars.GRAFANA_URL }}
GRAFANA_API_KEY: ${{ secrets.GRAFANA_API_KEY }}
MATTERMOST_WEBHOOK: ${{ vars.MATTERMOST_WEBHOOK }}
GRAFANA_DASHBOARD_UID: ${{ vars.GRAFANA_DASHBOARD_UID }}
run: |
set -euo pipefail
if [ "$(date -u +%u)" -eq 1 ]; then
bash ./run_table.sh 7d
else
bash ./run_table.sh 24h
fi
- name: Upload logs
if: always()
uses: actions/upload-artifact@v3
with:
name: report-logs
path: logs/table/*.log
if-no-files-found: ignore