DNS-as-code for graphql.now, hosted at Porkbun. Records
live in zones/graphql.now.yaml and are kept in
sync with Porkbun by octoDNS via the
octodns-porkbun provider.
Workflow:
- Edit
zones/graphql.now.yamlon a branch and open a PR. - GitHub Actions (
.github/workflows/dns-plan.yml) runsoctodns-syncin dry-run mode and posts the diff as a PR comment. - Review the diff, get it approved, merge.
- GitHub Actions (
.github/workflows/dns-apply.yml) runsoctodns-sync --doitonmain, which pushes the change to Porkbun.
No Terraform-style state file to manage: octoDNS diffs the YAML in this repo directly against Porkbun's live records on every run.
- Enable API access for the domain. In the Porkbun dashboard, under
Domain Management for
graphql.now, toggle "API Access" on. This is separate from having an account-level API key. - Create an API key. porkbun.com/account/api
→ generate a key. You get an API Key (
pk1_...) and a Secret API Key (sk1_...). - Add repo secrets. In this repo's Settings → Secrets and variables →
Actions, add:
PORKBUN_API_KEYPORKBUN_SECRET_KEY
- (Recommended) Protect the
productionenvironment. The apply workflow runs under theproductionGitHub environment (Settings → Environments → New environment →production). Add required reviewers there if you want a manual approval gate on top of PR review before changes actually hit Porkbun. - Seed real records (see below) before merging anything for real — the
committed
zones/graphql.now.yamlis currently a placeholder.
zones/graphql.now.yaml starts as a placeholder. To replace it with what's
actually live at Porkbun:
python3 -m venv .venv && source .venv/bin/activate
pip install -r requirements.txt
export PORKBUN_API_KEY=pk1_...
export PORKBUN_SECRET_KEY=sk1_...
octodns-dump --config-file=config/octodns.yaml --output-dir=zones --lenient graphql.now. porkbunThis overwrites zones/graphql.now.yaml with the current live records.
Review the diff, remove the placeholder comment, and commit.
source .venv/bin/activate
export PORKBUN_API_KEY=pk1_...
export PORKBUN_SECRET_KEY=sk1_...
octodns-validate --config-file=config/octodns.yaml # syntax/config check only
octodns-sync --config-file=config/octodns.yaml # dry run, prints the plan
octodns-sync --config-file=config/octodns.yaml --doit # actually applyconfig/octodns.yaml # octoDNS provider config (source: ./zones, target: Porkbun)
zones/graphql.now.yaml # source of truth for graphql.now records
.github/workflows/ # plan-on-PR, apply-on-merge