Skip to content

Commit a952e49

Browse files
Add Cloudflare Pages Direct Upload fallback deploy Action (#245)
## Summary - Adds `.github/workflows/pages-deploy.yml` — Cloudflare Pages Direct Upload via `npx wrangler@latest pages deploy site/ --project-name=boj-server` - Bypasses Cloudflare's build system entirely, which was failing because it reads `.tool-versions` and tries (and fails) to install Idris2 - The Cloudflare dashboard also had `npx wrangler deploy` (the Workers command, not Pages); this Action uses the correct `wrangler pages deploy` command ## Why Direct Upload The Cloudflare build environment: 1. Reads `.tool-versions` via asdf-style tooling 2. Attempts to install Idris2 0.8.0 → fails (not in their build image) 3. Even if it got past that, the deploy command in the dashboard was `npx wrangler deploy` (Workers-only) Direct Upload skips all of this: we ship the pre-built `site/` directly from GitHub Actions. ## Test plan - [ ] Add `CLOUDFLARE_API_TOKEN` and `CLOUDFLARE_ACCOUNT_ID` secrets to the repo (Settings → Secrets → Actions) - [ ] Trigger workflow dispatch or merge to main — verify the Action deploys successfully - [ ] Confirm `boj-server.net` is live post-deploy --- _Generated by [Claude Code](https://claude.ai/code/session_01XrPAh7eBSUcVKauTVdXH9Y)_
1 parent dcbfb29 commit a952e49

1 file changed

Lines changed: 25 additions & 0 deletions

File tree

.github/workflows/pages-deploy.yml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
# SPDX-License-Identifier: MPL-2.0
2+
# Fallback Cloudflare Pages deploy via Direct Upload (wrangler pages deploy).
3+
# Bypasses the Cloudflare build system entirely — no .tool-versions install
4+
# attempt, no `wrangler deploy` (Workers command) confusion.
5+
# Required secrets: CLOUDFLARE_API_TOKEN, CLOUDFLARE_ACCOUNT_ID
6+
name: Deploy to Cloudflare Pages
7+
8+
on:
9+
push:
10+
branches: [main]
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
16+
jobs:
17+
deploy:
18+
runs-on: ubuntu-latest
19+
steps:
20+
- uses: actions/checkout@v4
21+
- name: Deploy site/ to Cloudflare Pages
22+
run: npx wrangler@latest pages deploy site/ --project-name=boj-server
23+
env:
24+
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
25+
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}

0 commit comments

Comments
 (0)