Files
youtubezimu/.github/workflows/live-check.yml
T
gavindiaz 6ab8533faa
CI / build (20) (push) Canceled after 0s
CI / build (22) (push) Canceled after 0s
修改为docker部署
2026-09-08 21:17:01 +08:00

65 lines
2.2 KiB
YAML

name: Production API canary
# Best-effort nightly probe against the deployed production API. This checks the
# real hosted path users hit instead of asking YouTube directly from GitHub
# Actions, which is commonly blocked by YouTube's bot detection.
#
# This workflow does NOT fail the build. It opens / comments on a tracking
# issue if a run fails, so maintainers can investigate.
on:
schedule:
- cron: '0 6 * * *' # 06:00 UTC daily
workflow_dispatch:
permissions:
contents: read
issues: write
jobs:
prod:
runs-on: ubuntu-latest
continue-on-error: true
env:
CAPTION_API_BASE_URL: https://youtube-caption-extractor.vercel.app
CAPTION_API_VIDEO_IDS: 0Gb1z-2SjHY,D37Ijn2o5U0,g9JIUM0MHgQ,6BB6exR8Zd8,55pTFVoclvE
CAPTION_API_LANG: en
CAPTION_API_ATTEMPTS: 3
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 22
- name: Check production API
id: prod
run: node .github/scripts/check-production-api.mjs
- name: Open / update tracking issue on failure
if: failure() && steps.prod.outcome == 'failure'
env:
GH_TOKEN: ${{ secrets.GITHUB_TOKEN }}
RUN_URL: ${{ github.server_url }}/${{ github.repository }}/actions/runs/${{ github.run_id }}
run: |
TITLE="Nightly production API canary failed"
EXISTING=$(gh issue list --state open --search "$TITLE in:title" --json number --jq '.[0].number // empty')
BODY=$(cat <<EOF
The nightly production API check failed.
This workflow calls the deployed Vercel app at
\`$CAPTION_API_BASE_URL/api/videoDetails\` and validates that it
returns non-empty metadata and captions for dashboard sample videos.
**When to act:** if this issue keeps reopening, investigate the
deployed API path first: Vercel environment variables, proxy routing,
runtime errors, rate limits, or upstream YouTube/proxy behavior.
**Failed run:** $RUN_URL
EOF
)
if [ -n "$EXISTING" ]; then
gh issue comment "$EXISTING" --body "Failed again: $RUN_URL"
else
gh issue create --title "$TITLE" --body "$BODY"
fi