GitHub Actions and Worker Debugging
Why GitHub Actions is Hard to Debug | Reason | Explanation |-|
Section titled “Why GitHub Actions is Hard to Debug | Reason | Explanation |-|”| Ephemeral VM | Server disappears after execution ends | | No state | Cannot see files, DB, or environment like locally | | Only logs exist | Only stdout/stderr remains | | Non-determinism | API, network, timing differences | | Step-level failure | Unclear which command failed |
Essential Settings
Section titled “Essential Settings”Step Debug Mode
Section titled “Step Debug Mode”env: ACTIONS_STEP_DEBUG: true ACTIONS_RUNNER_DEBUG: trueBash Strict Mode
Section titled “Bash Strict Mode”set -euxo pipefailMust be placed at the top of CI scripts.
Shell First Structure
Section titled “Shell First Structure”- run: pnpm test- run: wrangler deploy- run: python crawl.py✅ Good
Section titled “✅ Good”- run: .github/scripts/ci.sh→ Running this locally is 100% identical to CI
tmate SSH (Debugging on Failure)
Section titled “tmate SSH (Debugging on Failure)”- name: Setup tmate session uses: mxschmitt/action-tmate@v3If CI fails, you can log in directly to the failed CI server via ssh xxx@tmate.io.
Cloudflare + Workers Architecture
Section titled “Cloudflare + Workers Architecture”GitHub Actions should only handle triggering.
GitHub Action ↓Call Ingress Worker ↓Queue ↓Consumer WorkersIf CI directly handles crawling·AI·DB·deployment, it becomes a debugging nightmare.
Recommended Flow
Section titled “Recommended Flow”GitHub Push ↓GitHub Action ↓ci.sh (로컬과 동일) ↓wrangler --dry-run ↓wrangler deploy preview ↓Queue trigger ↓Cloudflare WorkersLogpush for Evidence
Section titled “Logpush for Evidence”Worker version·build info logging:
const VERSION = "2026-01-27T1028Z";const BUILD = "git-<commit-hash>";
export default { fetch(req, env, ctx) { console.log("deploy", VERSION, BUILD); console.log("request", req.method, new URL(req.url).pathname); }}→ Cloudflare Logpush → R2 / Datadog / Logflare