Static portfolio site served by a Cloudflare Worker using Workers Static Assets.
public/— static site (HTML/CSS/JS). Editpublic/index.htmlto update content.wrangler.toml— Worker config.nameis overridden per-environment by the workflow..github/workflows/deploy.yml— CI/CD.
| Branch | Worker | Trigger | Domain |
|---|---|---|---|
feature |
personal-portfolio-dev |
Push to feature |
None (workers.dev subdomain only) |
master |
personal-portfolio-prod |
Push to master |
Mapped manually via Worker routes |
When a PR from feature is merged into master, the personal-portfolio-dev Worker is deleted.
The workflow never writes routes, so the production Worker's custom domain mapping stays intact across deploys.
Add these in Settings → Secrets and variables → Actions:
| Secret | Where to get it |
|---|---|
CLOUDFLARE_API_TOKEN |
Cloudflare dashboard → My Profile → API Tokens → Create Token → template Edit Cloudflare Workers (or a custom token with Account · Workers Scripts · Edit). |
CLOUDFLARE_ACCOUNT_ID |
Cloudflare dashboard → Workers & Pages overview → right sidebar Account ID. |
npm install -g wrangler
wrangler devwrangler deploy --name personal-portfolio-prod