Skip to content

Commit 024bcb6

Browse files
committed
Init
1 parent 021f6cf commit 024bcb6

File tree

10 files changed

+104
-2
lines changed

10 files changed

+104
-2
lines changed

.gitattributes

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
*.yaml linguist-detectable
2+
*.yml linguist-detectable

.github/pull_request_template.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

.github/workflows/deploy.yml

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
1+
name: Sync DNS
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
force:
7+
description: 'Use --force flag'
8+
required: false
9+
type: boolean
10+
default: false
11+
push:
12+
branches:
13+
- main
14+
15+
jobs:
16+
octodns:
17+
runs-on: ubuntu-latest
18+
steps:
19+
- uses: actions/checkout@v4
20+
- uses: actions/setup-python@v5
21+
with:
22+
python-version: '3'
23+
cache: "pip" # caches pip dependencies
24+
- name: Install OctoDNS
25+
run: pip install 'octodns==0.9.10'
26+
- name: Sync w/ production DNS providers
27+
run: ./bin/sync ${{ inputs.force && '--force' || '' }}
28+
env:
29+
# DNSIMPLE_ACCOUNT_NUMBER: ${{ secrets.DNSIMPLE_ACCOUNT_NUMBER }}
30+
# DNSIMPLE_API_KEY: ${{ secrets.DNSIMPLE_API_KEY }}

.github/workflows/test.yml

Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
name: Dry Run DNS
2+
3+
on:
4+
- push
5+
- pull_request
6+
- workflow_dispatch:
7+
inputs:
8+
force:
9+
description: 'Use --force flag'
10+
required: false
11+
type: boolean
12+
default: false
13+
14+
jobs:
15+
octodns:
16+
runs-on: ubuntu-latest
17+
steps:
18+
- uses: actions/checkout@v4
19+
- uses: actions/setup-python@v5
20+
with:
21+
python-version: '3'
22+
cache: "pip" # caches pip dependencies
23+
- name: Install OctoDNS
24+
run: pip install 'octodns==0.9.10'
25+
- name: Do a dry run
26+
run: ./bin/dry-run ${{ inputs.force && '--force' || '' }}
27+
env:
28+
# DNSIMPLE_ACCOUNT_NUMBER: ${{ secrets.DNSIMPLE_ACCOUNT_NUMBER }}
29+
# DNSIMPLE_API_KEY: ${{ secrets.DNSIMPLE_API_KEY }}

.github/workflows/validate.yml

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
name: Validate DNS Configs
2+
on:
3+
push:
4+
branches:
5+
- main
6+
pull_request:
7+
workflow_dispatch:
8+
9+
permissions:
10+
contents: read
11+
pull-requests: write
12+
13+
jobs:
14+
json-yaml-validate:
15+
runs-on: ubuntu-latest
16+
steps:
17+
- uses: actions/checkout@v4
18+
19+
- name: Validate JSON & YAML
20+
id: json-yaml-validate
21+
uses: GrantBirki/[email protected]
22+
with:
23+
comment: "true"

bin/dry-run

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
#!/bin/sh
22

3-
octodns-sync --config-file=./config/main.yaml
3+
FORCE_FLAG=""
4+
if [ "$1" = "--force" ]; then
5+
FORCE_FLAG="--force"
6+
fi
7+
8+
octodns-sync --config-file=./config/main.yaml $FORCE_FLAG

bin/dry-run-force

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
octodns-sync --config-file=./config/main.yaml --force

bin/sync

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,8 @@
11
#!/bin/sh
22

3-
octodns-sync --config-file=./config/main.yaml --doit
3+
FORCE_FLAG=""
4+
if [ "$1" = "--force" ]; then
5+
FORCE_FLAG="--force"
6+
fi
7+
8+
octodns-sync --config-file=./config/main.yaml --doit $FORCE_FLAG

bin/sync-force

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#!/bin/sh
2+
3+
octodns-sync --config-file=./config/main.yaml --doit --force

config/main.yaml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+

0 commit comments

Comments
 (0)