Preview and apply DNS changes in CI
Martin Weinelt committed
Mar 29, 2025 at 03:48 UTC
c0b33629bbd40f40971434d493be200416f4301f
2 files changed
+60
.github/workflows/dns-apply.yml
new
+31
@@ -0,0 +1,31 @@
1
+---
2
+name: Apply DNS changes
3
+
4
+on:
5
+ push:
6
+ branches:
7
+ - main
8
+ paths:
9
+ - dns/
10
+ workflow_dispatch:
11
+
12
+permissions: {}
13
+
14
+jobs:
15
+ dnscontrol:
16
+ runs-on: ubuntu-latest
17
+ strategy:
18
+ fail-fast: true
19
+ steps:
20
+ - uses: actions/checkout@v4.2.2
21
+ - uses: cachix/install-nix-action@v31
22
+ - name: dnscontrol check
23
+ working-directory: ./dns/
24
+ run: |
25
+ nix run --inputs-from . nixpkgs#dnscontrol -- check
26
+ - name: dnscontrol push
27
+ env:
28
+ NETLIFY_TOKEN: "${{ secrets.NETLIFY_TOKEN }}"
29
+ working-directory: ./dns/
30
+ run: |
31
+ nix run --inputs-from . nixpkgs#dnscontrol -- push
.github/workflows/dns-preview.yml
new
+29
@@ -0,0 +1,29 @@
1
+---
2
+name: Test/Preview DNS changes
3
+
4
+on:
5
+ pull_request:
6
+ paths:
7
+ - dns/
8
+
9
+permissions: {}
10
+
11
+jobs:
12
+ dnscontrol:
13
+ runs-on: ubuntu-latest
14
+ strategy:
15
+ fail-fast: false
16
+ steps:
17
+ - uses: actions/checkout@v4.2.2
18
+ - uses: cachix/install-nix-action@v31
19
+ - name: dnscontrol check
20
+ working-directory: ./dns/
21
+ run: |
22
+ nix run --inputs-from . nixpkgs#dnscontrol -- check
23
+ - name: dnscontrol preview
24
+ if: github.repository == 'nixos/infra'
25
+ env:
26
+ NETLIFY_TOKEN: "${{ secrets.NETLIFY_TOKEN }}"
27
+ working-directory: ./dns/
28
+ run: |
29
+ nix run --inputs-from . nixpkgs#dnscontrol -- preview