GitHub Secrets Setup
Step-by-step guide to configure GitHub Actions secrets for automated deployment to Cloudflare Pages.
GitHub Actions Secrets Setup
This guide helps you configure the required secrets for automated deployment.
Required Secrets
1. CLOUDFLARE_API_TOKEN
Purpose: Allows GitHub Actions to deploy to Cloudflare Pages
How to Create:
- Go to Cloudflare Dashboard
- Click “Create Token”
- Use “Custom token” template
- Configure:
Token name: "GitHub Actions - LATTS Docs" Permissions: - Account:Cloudflare Pages:Edit - Zone:Zone:Read - Zone:Page Rules:Edit Account resources: Include - Your Account Zone resources: Include - latts.ie (or your domain) - Click “Continue to summary” → “Create Token”
- Copy the token (you won’t see it again!)
2. CLOUDFLARE_ACCOUNT_ID
Purpose: Identifies your Cloudflare account for deployment
How to Find:
- Go to Cloudflare Dashboard
- Look in the right sidebar under “Account ID”
- Copy the ID (format:
1234567890abcdef1234567890abcdef)
Adding Secrets to GitHub
Navigate to Repository Settings
GitHub → latts-ie/wiki-internal → Settings → Secrets and variables → ActionsAdd Each Secret
Click “New repository secret”
Name:
CLOUDFLARE_API_TOKENValue:
[paste your API token]Click “Add secret”
Click “New repository secret”
Name:
CLOUDFLARE_ACCOUNT_IDValue:
[paste your account ID]Click “Add secret”
Verification
Once secrets are added, the GitHub Actions workflow will:
- ✅ Deploy to production on pushes to
mainbranch - ✅ Deploy preview versions for pull requests
- ✅ Run automated tests before deployment
- ✅ Comment on PRs with preview URLs
Security Notes
- API tokens are encrypted and only accessible to GitHub Actions
- Tokens can be revoked/regenerated at any time in Cloudflare
- Regular token rotation is recommended (every 90 days)
Next Steps
After adding secrets:
- Push changes to trigger first automated deployment
- Create a test PR to verify preview deployments work
- Monitor GitHub Actions tab for deployment status