Skip to content

Deploy Documentation to Cloudflare Pages at rails49.org

  1. Link the Custom Domain

    1. Log in to the Cloudflare Dashboard.
    2. Go to Workers & Pages > Overview.
    3. Select your new project: rails49-doc.
    4. Click on the Custom domains tab.
    5. Click Set up a custom domain.
    6. 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.)
  2. 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:

    1. Go to your GitHub Repository > Settings > Secrets and variables > Actions.
    2. 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.
  3. 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.