diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..68ac85d --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,27 @@ +name: deploy + +on: + workflow_dispatch: + push: + branches: + - main + +jobs: + octodns: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Deploy to production + run: ./scripts/deploy.sh + env: + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml new file mode 100644 index 0000000..5039c56 --- /dev/null +++ b/.github/workflows/test.yml @@ -0,0 +1,25 @@ +name: test + +on: + push: + pull_request: + +jobs: + octodns: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Set up Python + uses: actions/setup-python@v5 + with: + python-version: '3.x' + + - name: Install dependencies + run: pip install -r requirements.txt + + - name: Dry run + run: ./scripts/dry-run.sh + env: + CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }} diff --git a/.github/workflows/validate.yml b/.github/workflows/validate.yml new file mode 100644 index 0000000..9831eba --- /dev/null +++ b/.github/workflows/validate.yml @@ -0,0 +1,23 @@ +name: validate + +on: + push: + branches: + - main + pull_request: + +permissions: + contents: read + pull-requests: write + +jobs: + json-yaml-validate: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Validate YAML + uses: GrantBirki/json-yaml-validate@v2.6.2 + with: + comment: "true" diff --git a/scripts/deploy.sh b/scripts/deploy.sh new file mode 100644 index 0000000..bbec603 --- /dev/null +++ b/scripts/deploy.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +octodns-sync --config-file=./config/produciton.yaml --doit diff --git a/scripts/dry-run.sh b/scripts/dry-run.sh new file mode 100644 index 0000000..e43652a --- /dev/null +++ b/scripts/dry-run.sh @@ -0,0 +1,3 @@ +#!/bin/sh + +octodns-sync --config-file=./config/produciton.yaml