Skip to content

Blog

blog/index.md

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.

Rails49 Docker App

Traefik

Requires a Cloudflare API token with DNS-01 challenge support.

  1. Zone / DNS / Edit: This allows Traefik to create and delete the _acme-challenge TXT records.
  2. Zone / Zone / Read: This allows Traefik to find the correct Zone ID for your domain.

Steps to create the token: 1. Go to My Profile > API Tokens in your Cloudflare dashboard. 2. Click Create Token. 3. Choose Create Custom Token. 4. Name it (e.g., Traefik DNS Challenge). 5. Add the two permissions mentioned above. 6. Under Zone Resources, select Include > Specific zone > rails49.org (or "All zones" if you prefer). Copy the generated token immediately (it won't be shown again).

Then copy the token to the .env file:

RAILS_DOMAIN=rails49.org
CF_DNS_API_TOKEN=your_new_token_here

Configure DNS Resolution on you Router

Configure the router for local dns resolution. My router (a GL.iNet) allows editing the hosts file under Network > DNS. Add the following (update the IP addresses):

192.168.8.235 rails49.org
192.168.8.235 code.rails49.org

Commands

  • deploy to balena: ./bin/deploy
  • run tests: ./bin/test

DCC-EX protocol

Native commands