Deploy Documentation to Cloudflare Pages at rails49.org
-
Link the Custom Domain
- Log in to the Cloudflare Dashboard.
- Go to Workers & Pages > Overview.
- Select your new project: rails49-doc.
- Click on the Custom domains tab.
- Click Set up a custom domain.
- Enter rails49.org and follow the prompts to activate it. (Since your DNS is already on Cloudflare, it should offer to automatically create the necessary CNAME record for you.)
-
Set Up GitHub Secrets (for Automation) To enable the "Tag-Prefix" automated deployment we set up ( .github/workflows/deploy-docs.yml ), you need to add two secrets to your GitHub repository:
- Go to your GitHub Repository > Settings > Secrets and variables > Actions.
- Add the following Repository secrets:
- CLOUDFLARE_API_TOKEN: Create this in Cloudflare under My Profile > API Tokens using "Create Custom Token" with Permissions: Account | Cloudflare Pages | Edit.
- CLOUDFLARE_ACCOUNT_ID: Found on the right-hand sidebar of your Cloudflare Dashboard's Account Home page.
-
Verification Once the custom domain is linked, you can test it by tagging a commit:
git tag doc-v0.1.0
git push origin doc-v0.1.0
This will trigger the GitHub Action, which will build and deploy the site automatically.