-
Notifications
You must be signed in to change notification settings - Fork 421
Migrate docs to Vocs v2 and Bun #2536
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Changes from 4 commits
c83704d
5aff44f
5facaeb
3902a95
4183927
5778a7c
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,83 @@ | ||
| # Optional Cloudflare Pages deploy for the Vocs migration branch. | ||
| # | ||
| # Mirrors the Eden docs pattern: build a full-static Vocs site, copy a Pages | ||
| # advanced-mode Worker into the output as _worker.js for /mcp and /api/mcp, | ||
| # then deploy the output directory to Cloudflare Pages. | ||
| # | ||
| # Requires CLOUDFLARE_API_TOKEN and CLOUDFLARE_ACCOUNT_ID repo secrets. | ||
| name: Deploy to Cloudflare Pages | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| # Temporary branch trigger for testing the Vocs migration before this | ||
| # workflow exists on the default branch. | ||
| push: | ||
| branches: | ||
| - codex/jcs/migrate-vocs-v2-bun | ||
| pull_request: | ||
| types: | ||
| - opened | ||
| - reopened | ||
| - synchronize | ||
|
|
||
| concurrency: | ||
| group: deploy-cloudflare-${{ github.ref }} | ||
| cancel-in-progress: true | ||
|
|
||
| env: | ||
| CLOUDFLARE_PAGES_PROJECT: ${{ vars.CLOUDFLARE_PAGES_PROJECT || 'celestia-docs-vocs-test' }} | ||
|
|
||
| jobs: | ||
| deploy: | ||
| if: github.event_name != 'pull_request' || github.event.pull_request.head.repo.full_name == github.repository | ||
| runs-on: ubuntu-latest | ||
| steps: | ||
| - name: Checkout | ||
| uses: actions/checkout@v6 | ||
|
|
||
| - name: Setup Bun | ||
| uses: oven-sh/setup-bun@v2 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow or composite action Medium
Unpinned 3rd party Action 'Deploy to Cloudflare Pages' step
Uses Step Error loading related location Loading |
||
| with: | ||
| bun-version: latest | ||
|
|
||
| - name: Install dependencies | ||
| run: bun install --frozen-lockfile | ||
|
|
||
| - name: Build site and add MCP worker | ||
| run: bun run prepare:cloudflare | ||
|
|
||
| - name: Check Cloudflare secrets | ||
| id: cloudflare | ||
| env: | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| run: | | ||
| if [[ -z "$CLOUDFLARE_API_TOKEN" || -z "$CLOUDFLARE_ACCOUNT_ID" ]]; then | ||
| echo "::notice::Cloudflare secrets are not set; skipping deploy." | ||
| echo "skip=true" >> "$GITHUB_OUTPUT" | ||
| else | ||
| echo "skip=false" >> "$GITHUB_OUTPUT" | ||
| fi | ||
|
|
||
| - name: Ensure Cloudflare Pages project exists | ||
| if: steps.cloudflare.outputs.skip != 'true' | ||
| env: | ||
| CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| run: | | ||
| set +e | ||
| output="$(bunx wrangler pages project create "$CLOUDFLARE_PAGES_PROJECT" --production-branch main 2>&1)" | ||
| status=$? | ||
| set -e | ||
| echo "$output" | ||
| if [[ "$status" -ne 0 && "$output" != *"already exists"* ]]; then | ||
| exit "$status" | ||
| fi | ||
|
|
||
| - name: Deploy | ||
| if: steps.cloudflare.outputs.skip != 'true' | ||
| uses: cloudflare/wrangler-action@v3 | ||
Check warningCode scanning / CodeQL Unpinned tag for a non-immutable Action in workflow or composite action Medium
Unpinned 3rd party Action 'Deploy to Cloudflare Pages' step
Uses Step Error loading related location Loading |
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
| with: | ||
| apiToken: ${{ secrets.CLOUDFLARE_API_TOKEN }} | ||
| accountId: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }} | ||
| command: pages deploy out/public --project-name ${{ env.CLOUDFLARE_PAGES_PROJECT }} --branch ${{ github.head_ref || github.ref_name }} | ||
Check warningCode scanning / CodeQL Workflow does not contain permissions Medium
Actions job or workflow does not limit the permissions of the GITHUB_TOKEN. Consider setting an explicit permissions block, using the following as a minimal starting point: {contents: read}
|
||
|
github-advanced-security[bot] marked this conversation as resolved.
Fixed
|
||
Uh oh!
There was an error while loading. Please reload this page.