mirror of
https://github.com/prdlk/leetcode.git
synced 2026-11-04 21:47:38 +00:00
feat(docs): move the site to prdcs.wiki on a Cloudflare Worker
Blume's cloudflare() adapter builds the docs as the prdcs-wiki Worker (apps/docs/wrangler.jsonc: name, prdcs.wiki custom domain), and deploy.yml ships it with wrangler instead of GitHub Pages. The SRS Worker's DOCS_URL / DOCS_ORIGIN, release links and README badge follow the new domain.
This commit is contained in:
1 parent
2835f618aa
commit
dd796acbae
15 files changed
+643
-212
No files matched your search
@@ -7,18 +7,20 @@ on:
|
||||
|
||||
permissions:
|
||||
contents: read
|
||||
pages: write
|
||||
id-token: write
|
||||
|
||||
# The Worker deploy is idempotent (wrangler uploads the whole bundle), so on a
|
||||
# burst of pushes only the last one matters: cancel-in-progress is correct for
|
||||
# both the Pages build and the Worker job.
|
||||
# Both Workers deploy idempotently (wrangler uploads the whole bundle and
|
||||
# only changed assets), so on a burst of pushes only the last one matters:
|
||||
# cancel-in-progress is correct for both jobs.
|
||||
concurrency:
|
||||
group: deploy
|
||||
cancel-in-progress: true
|
||||
|
||||
jobs:
|
||||
build:
|
||||
# The docs site: a Blume `cloudflare()` server build (apps/docs/blume.config.ts)
|
||||
# deployed as the `prdcs-wiki` Worker on the prdcs.wiki custom domain
|
||||
# (apps/docs/wrangler.jsonc). Needs CLOUDFLARE_API_TOKEN to also carry
|
||||
# Workers Routes: Edit on the prdcs.wiki zone for the custom domain.
|
||||
deploy-docs:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v4
|
||||
@@ -27,7 +29,7 @@ jobs:
|
||||
with:
|
||||
node-version: 22 # Blume requires 22.12+
|
||||
|
||||
- uses: oven-sh/setup-bun@v2 # skip if you use npm/pnpm
|
||||
- uses: oven-sh/setup-bun@v2
|
||||
|
||||
- run: bun install --frozen-lockfile
|
||||
# pages/changelog.astro reads this repo's GitHub releases at build time
|
||||
@@ -38,19 +40,12 @@ jobs:
|
||||
env:
|
||||
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- uses: actions/upload-pages-artifact@v3
|
||||
with:
|
||||
path: apps/docs/dist
|
||||
|
||||
deploy:
|
||||
needs: build
|
||||
runs-on: ubuntu-latest
|
||||
environment:
|
||||
name: github-pages
|
||||
url: ${{ steps.deployment.outputs.page_url }}
|
||||
steps:
|
||||
- id: deployment
|
||||
uses: actions/deploy-pages@v4
|
||||
# `blume build` writes .wrangler/deploy/config.json, which points
|
||||
# wrangler at the built dist/server/wrangler.json.
|
||||
- run: bun run docs:deploy
|
||||
env:
|
||||
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
|
||||
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
|
||||
|
||||
# Deploys on every main push (not path-filtered): apps/api/data/schedule.json
|
||||
# is bundled at deploy time, and re-deploying an unchanged Worker is a no-op.
|
||||
|
||||
Reference in new issue
Block a user