In this post Sven Luijten uses DNSControl from within GitHub Actions to manage DNS:
What if you could edit a JavaScript file with your desired DNS configuration, submit a pull request on GitHub, see a preview of the changes you are about to make, and when you merge it, have those changes be applied completely automatically?
The main action behind it is koenrh/dnscontrol-action
:
# .github/workflows/push.yml
name: Push DNS changes
on:
push:
branches:
- main
jobs:
push:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Push DNS changes
uses: koenrh/dnscontrol-action@v3
env:
CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }}
with:
args: push
The action also supports more arguments — as covered in Sven’s post — for checking and previewing.