Skip to content

Commit

Permalink
Merge pull request #1 from Scrapyard-London/main-update!
Browse files Browse the repository at this point in the history
Main update!
  • Loading branch information
leowilkin authored Jan 6, 2025
2 parents 4bceacd + 990e3e8 commit 0559594
Show file tree
Hide file tree
Showing 8 changed files with 106 additions and 0 deletions.
11 changes: 11 additions & 0 deletions .github/pull_request_template.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
<!--
Please pick one option when multiple are presented in brackets.
Please title your PR like this: [Adding/Deleting/Updating] `subdomain.[scrapyard.london]`
-->

# [Adding/Deleting/Updating] `subdomain.[scrapyard.london]`

## Description

Provide a description here of the changes, and if adding a subdomain provide a rationale & what it will be used for.
23 changes: 23 additions & 0 deletions .github/workflows/deploy.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: deploy

on:
workflow_dispatch:
push:
branches:
- main

jobs:
octodns:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-python@v5
with:
python-version: '3'
- name: Install OctoDNS
run: pip install 'octodns==1.10.0' 'octodns-cloudflare==0.0.7'
- name: Sync w/ production DNS providers
run: ./bin/sync
env:
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
24 changes: 24 additions & 0 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: test

on:
push:
pull_request_target:

jobs:
octodns:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
with:
# Ensures the workflow checks out the base branch, not the PR branch
ref: ${{ github.event.pull_request.base.ref }}
- uses: actions/setup-python@v5
with:
python-version: '3'
- name: Install OctoDNS
run: pip install 'octodns==1.10.0' 'octodns-cloudflare==0.0.7'
- name: Do a dry run
run: ./bin/dry-run
env:
CLOUDFLARE_EMAIL: ${{ secrets.CLOUDFLARE_EMAIL }}
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
23 changes: 23 additions & 0 deletions .github/workflows/validate.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: json-yaml-validate
on:
push:
branches:
- main
pull_request:
workflow_dispatch:

permissions:
contents: read
pull-requests: write

jobs:
json-yaml-validate:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4

- name: json-yaml-validate
id: json-yaml-validate
uses: GrantBirki/json-yaml-validate@v2.7.1
with:
comment: "true"
3 changes: 3 additions & 0 deletions bin/dry-run
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

octodns-sync --config-file=./config/production.yaml
3 changes: 3 additions & 0 deletions bin/sync
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
#!/bin/sh

octodns-sync --config-file=./config/production.yaml --doit
18 changes: 18 additions & 0 deletions config/production.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
---
providers:
config:
class: octodns.provider.yaml.YamlProvider
directory: ./
enforce_order: False
cloudflare:
class: octodns_cloudflare.CloudflareProvider
email: env/CLOUDFLARE_EMAIL
token: env/CLOUDFLARE_TOKEN
delete_pcent_threshold: 1.0

zones:
scrapyard.london.:
sources:
- config
targets:
- cloudflare
1 change: 1 addition & 0 deletions scrapyard.london.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
---

0 comments on commit 0559594

Please # to comment.