Publish the docs site
Status: plan, not yet done. Each Cloudflare and Google step below was checked against their documentation on 29 Nov 2026, but the screens change: where a button name differs on your screen, use the closest one and tell me.
This guide publishes the one Bideward docs site (how it works).
0. The values
Section titled “0. The values”| Item | Value |
|---|---|
| Pages project name | bideward-docs |
| Hostname | docs.bideward.com |
| Zero Trust team name | bideward (sign-in address bideward.cloudflareaccess.com) |
| Who may open it | You |
What is verified, and what it costs
Section titled “What is verified, and what it costs”| Fact | Source |
|---|---|
| Pages Free plan: 500 builds a month, 20,000 files per site, 25 MiB per file, 100 projects per account, 100 custom domains per project, one build at a time. | Cloudflare Pages limits page |
| Requests for static assets are free and unlimited on free and paid plans. | Cloudflare Pages pricing page |
| Zero Trust Free plan: $0 and up to 50 users, including Access. | Cloudflare Zero Trust plans page |
The default Node version of the Pages build is 22.23.4, the version this site was built with, so no NODE_VERSION setting is needed. |
Cloudflare Pages language support page |
1. Merge the pull request
Section titled “1. Merge the pull request”EXPLAIN — why: the site is built from the main branch. Merging first makes main the one production source from the first build.
DO: GitHub → the docs pull request → Merge pull request.
VERIFY — you should see: docs/ and docs-site/ on main.
2. Create the Pages project (Git integration)
Section titled “2. Create the Pages project (Git integration)”EXPLAIN — why: Pages builds the site from the repository and hosts the files free. Choose Git integration, not direct upload: Cloudflare states a Git project cannot be switched to direct upload later, and its repository cannot be changed later either (a repository move means a new project; see how the docs site works).
DO:
- dash.cloudflare.com → Workers & Pages → create a Pages project → Connect to Git → authorise GitHub → choose the repository.
- Project name
bideward-docs(step 0). Production branchmain. - Build settings: framework preset Astro (build command
npm run build, output directorydist); set the build command tonpm ci && npm run buildand the root directory todocs-site. - No variables are needed: the build reads
docs/by default. - Save and Deploy.
VERIFY — you should see: a build log ending in “Complete!” and a working <project>.pages.dev address. That address is public until step 6: do not share it, and finish the steps in order.
3. Attach the hostname
Section titled “3. Attach the hostname”EXPLAIN — why: the hostname is the address people use; Cloudflare creates its DNS record for you because bideward.com is a zone in your Cloudflare account.
DO: the project → Custom domains → Set up a domain → enter docs.bideward.com → Continue, and confirm the DNS record when it asks.
VERIFY — you should see: the domain status turning Active and the site opening on the hostname. You do not create the subdomain anywhere else.
4. Turn on Zero Trust (Free plan)
Section titled “4. Turn on Zero Trust (Free plan)”EXPLAIN — why: Zero Trust holds Access, the sign-in in front of the site.
DO: dash.cloudflare.com → Zero Trust. The first time it asks you to choose a team name (use bideward; your sign-in address becomes bideward.cloudflareaccess.com) and a plan: choose Free. Your account already has a payment method; the Free plan is $0.
VERIFY — you should see: the Zero Trust dashboard with Access controls in the menu.
5. Add Google as the sign-in method
Section titled “5. Add Google as the sign-in method”EXPLAIN — why: Google sign-in means Cloudflare relies on your Google account, with its 2-step verification, instead of mailing a code.
DO:
- Google Cloud console → create a project (for example
bideward-access). - APIs & Services → Credentials: configure the consent screen, audience External, an app name, a support e-mail and a contact e-mail. If the screen shows the app in Testing, add your own Google address as a test user (Google’s screen; verify on screen).
- Create an OAuth client, type Web application.
- Authorized JavaScript origin:
https://<your-team-name>.cloudflareaccess.com - Authorized redirect URI:
https://<your-team-name>.cloudflareaccess.com/cdn-cgi/access/callback - Copy the Client ID and Client secret into your password manager.
- Zero Trust → Integrations → Identity providers → Add new identity provider → Google → paste the Client ID (labelled App ID) and the secret. You can turn on PKCE. Save, then press Test next to Google.
VERIFY — you should see: Google in the identity-provider list and the test succeeding. If logins later fail with Error 401: deleted_client, the OAuth client was deleted in Google: create it again and update the values in Cloudflare.
6. Protect the site with Access
Section titled “6. Protect the site with Access”EXPLAIN — why: until now every address of the site is public. Each address needs its own protection: the custom domain, the pages.dev address and the preview addresses.
6a. The custom domain
Section titled “6a. The custom domain”DO:
- Zero Trust → Access controls → Applications → Add an application → Self-hosted.
- Name
Bideward docs. Public hostname: enter the subdomaindocsand choose the domainbideward.comfrom the list. - Session duration: 24 hours: how long a sign-in lasts before Access asks again. You may choose another value.
- Policy: action Allow, rule Emails → your Google address.
- Identity providers: enable Google only. With only one provider enabled you can turn on instant authentication, so people go straight to Google’s sign-in.
- Save.
6b. The pages.dev address and the previews (Cloudflare’s documented procedure)
Section titled “6b. The pages.dev address and the previews (Cloudflare’s documented procedure)”EXPLAIN — why: Cloudflare’s own switch protects only preview addresses; the production pages.dev address needs one more change. Cloudflare’s documentation lists these steps; follow them in this order.
DO:
- Workers & Pages → the project → Settings → General → Enable access policy. This creates an Access application for the previews, on the hostname
*.<project>.pages.dev. - Select Manage on that policy. Under Access controls → Applications, open the project’s application → Configure.
- In Public hostname, in the Subdomain field, remove the
*so the application protects<project>.pages.devitself. If it complains, change the application name. Save. - Back in the project’s Settings → General, enable the access policy again, which creates the preview application once more.
- Confirm that two applications exist: one for
<project>.pages.devand one for*.<project>.pages.dev. - Open each, and set the policy to Allow with your Google address only, Google as the only identity provider.
Cloudflare’s documentation states: without an Access policy for the custom domain, the sign-in page appears but does not work for visitors of the custom domain; that is why 6a exists.
VERIFY — you should see, in a private browser window, for all three addresses: https://<hostname>, https://<project>.pages.dev, and a preview address (push any change to a branch other than main and open the address of its build): the Cloudflare/Google sign-in page and nothing of the site. After “Sign in with Google” with your address the site opens and the search finds a word from the guide; a different Google account is refused.
7. Day to day: editing, updating, rolling back
Section titled “7. Day to day: editing, updating, rolling back”| What you do | What happens |
|---|---|
Merge or push a change to main |
Pages rebuilds and replaces the site. |
| Push another branch | A preview build at its own address, protected by the preview application. |
| A build fails | The previous site stays up; read the build log in Deployments. |
| You want the previous version | Deployments → the three-dot menu of an earlier production deployment → Rollback to this deployment, then confirm. Only successful production deployments can be a rollback target; deployments older than 30 days are deleted except the 100 most recent and the current one. |
| Many small edits | Group them into fewer pushes: the free plan has 500 builds a month. |
8. A service token for an AI tool or a script (later)
Section titled “8. A service token for an AI tool or a script (later)”EXPLAIN — why: today AI tools read the Markdown from GitHub. If one ever needs the published site, give it its own credential that you can revoke, not your login.
DO:
- Zero Trust → Access controls → Service credentials → Service Tokens → Create Service Token. Name it after the tool and choose the duration. Copy the Client Secret now: Cloudflare shows it only once; if you lose it, create a new token.
- Open the site’s Access application → add a second policy: action Service Auth, rule Service Token → the token. (Any other action makes Access ask for a login.)
- The tool sends the headers
CF-Access-Client-IdandCF-Access-Client-Secret.
VERIFY — you should see: a request with both headers returns the page; one without them is refused. To stop the tool, delete the token.
Use a separate token for each tool, so one leak opens one tool’s access only.
9. When the repository moves
Section titled “9. When the repository moves”The move of the repository into the bideward GitHub organisation, and what changes when it happens, are on how the docs site works.