# tomtervel.no's DNS: dns/dnsconfig.js, applied to Cloudflare by # DNSControl on kasse's host runner. A push that touches dns/, on any # branch, shows what would change (`preview`) and changes nothing. The # change itself is a person's: Actions -> dns -> Run workflow, on main. # So merging is not the cutover; pressing the button is. # # Push only, never pull_request: the repo is public, and a stranger's pull # request must not run on kasse with the token. The token is the repo # secret CLOUDFLARE_API_TOKEN, DNS edit for tomtervel.no only # (dns/README.md). name: dns on: push: paths: - dns/** - .gitea/workflows/dns.yml workflow_dispatch: jobs: dns: runs-on: fish env: DNSCONTROL_VERSION: ${{ vars.DNSCONTROL_VERSION }} CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} steps: - uses: actions/checkout@v4 # The release binary, fetched once per version into the runner's # own cache (its built-in cache server) and checked against the # release's checksums when it is. - name: Cache dnscontrol id: cache uses: actions/cache@v4 with: path: ~/.cache/dnscontrol key: dnscontrol-${{ vars.DNSCONTROL_VERSION }}-linux-amd64 - name: Fetch dnscontrol if: steps.cache.outputs.cache-hit != 'true' run: | [ -n "$DNSCONTROL_VERSION" ] || { echo "the DNSCONTROL_VERSION variable is not set"; exit 1; } mkdir -p ~/.cache/dnscontrol cd "$(mktemp -d)" base="https://github.com/StackExchange/dnscontrol/releases/download/v$DNSCONTROL_VERSION" tar="dnscontrol_${DNSCONTROL_VERSION}_linux_amd64.tar.gz" curl -sfLO "$base/$tar" curl -sfLO "$base/checksums.txt" grep " $tar\$" checksums.txt | sha256sum -c - tar -xzf "$tar" dnscontrol install -m 0755 dnscontrol ~/.cache/dnscontrol/dnscontrol - name: check working-directory: dns run: ~/.cache/dnscontrol/dnscontrol check - name: preview working-directory: dns run: ~/.cache/dnscontrol/dnscontrol preview - name: push if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' working-directory: dns run: ~/.cache/dnscontrol/dnscontrol push