# 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: 5.7.2 CLOUDFLARE_API_TOKEN: ${{ secrets.CLOUDFLARE_API_TOKEN }} steps: - name: checkout run: | rm -rf checkout git clone --depth 1 --branch "${{ github.ref_name }}" "${{ github.server_url }}/${{ github.repository }}.git" checkout # The release binary, checked against the release's own checksums, # kept in the runner user's cache so each version is fetched once. - name: dnscontrol run: | mkdir -p "$HOME/.cache/dnscontrol" bin="$HOME/.cache/dnscontrol/dnscontrol-$DNSCONTROL_VERSION" if [ ! -x "$bin" ]; then tmp=$(mktemp -d) base="https://github.com/StackExchange/dnscontrol/releases/download/v$DNSCONTROL_VERSION" tar="dnscontrol_${DNSCONTROL_VERSION}_linux_amd64.tar.gz" curl -sfL "$base/$tar" -o "$tmp/$tar" curl -sfL "$base/checksums.txt" -o "$tmp/checksums.txt" (cd "$tmp" && grep " $tar\$" checksums.txt | sha256sum -c -) tar -xzf "$tmp/$tar" -C "$tmp" dnscontrol install -m 0755 "$tmp/dnscontrol" "$bin" rm -rf "$tmp" fi "$bin" version echo "DNSCONTROL=$bin" >> "$GITHUB_ENV" - name: check working-directory: checkout/dns run: $DNSCONTROL check - name: preview working-directory: checkout/dns run: $DNSCONTROL preview - name: push if: github.event_name == 'workflow_dispatch' && github.ref == 'refs/heads/main' working-directory: checkout/dns run: $DNSCONTROL push