GithubHelp home page GithubHelp logo

the-periodic-table-of-elements / octodns-sync Goto Github PK

View Code? Open in Web Editor NEW

This project forked from antonydevanchi/octodns-sync

0.0 0.0 0.0 118 KB

GitHub Action to test and deploy DNS settings with octodns

License: MIT License

Dockerfile 7.27% Shell 92.73%

octodns-sync's Introduction

octodns-sync

This action runs octodns-sync from github/octodns to deploy your DNS config to any cloud.

octodns allows you to manage your DNS records in a portable format and publish changes across different DNS providers. It is extensible and customizable.

When you manage your octodns DNS configuration in a GitHub repository, this GitHub Action allows you to test and publish your changes automatically using a workflow you define.

Example workflow

name: octodns-sync

on:
  # Deploy config whenever DNS changes are pushed to main.
  push:
    branches:
      - main
    paths:
      - '*.yaml'

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.route53_aws_key_id }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.route53_aws_secret_access_key }}

jobs:
  publish:
    name: Publish DNS config from main
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v2
      - name: Publish
        uses: solvaholic/octodns-sync@v2
        with:
          config_path: public.yaml
          doit: --doit

Inputs

Secrets

(Required) To authenticate with your DNS provider, this action uses encrypted secrets you've configured on your repository. For example, if you use Amazon Route53, create these secrets on the repository where you store your DNS configuration:

"route53-aws-key-id": "YOURIDGOESHERE"
"route53-aws-secret-access-key": "YOURKEYGOESHERE"

Then include them as environment variables in your workflow. For example:

env:
  AWS_ACCESS_KEY_ID: ${{ secrets.route53-aws-key-id }}
  AWS_SECRET_ACCESS_KEY: ${{ secrets.route53-aws-secret-access-key }}

config-path

(Required) Path, relative to your repository root, of the config file you would like octodns to use.

Default "public.yaml".

doit

(Optional) Really do it? Set "--doit" to do it; Any other string to not do it.

Default "" (empty string).

Outputs

octodns-sync will compare your configuration file to the configurations your providers have, and report any planned changes. For example:

********************************************************************************
* example.org.
********************************************************************************
* route53 (Route53Provider)
*   Update
*     <CnameRecord CNAME 3600, mail.example.org., before.example.org.> ->
*     <CnameRecord CNAME 3600, mail.example.org., after.example.org.> (config)
*   Create <ARecord A 3600, after.example.org., ['192.168.0.33']> (config)
*   Create <CaaRecord CAA 3600, after.example.org., ['0 issue "letsencrypt.org"']> (config)
*   Delete <ARecord A 3600, before.example.org., ['192.168.0.33']>
*   Delete <CaaRecord CAA 3600, before.example.org., ['0 issue "letsencrypt.org"']>
*   Update
*     <CnameRecord CNAME 3600, www.example.org., before.example.org.> ->
*     <CnameRecord CNAME 3600, www.example.org., after.example.org.> (config)
*   Summary: Creates=2, Updates=2, Deletes=2, Existing Records=8

Run locally

_image=ghcr.io/solvaholic/octodns-sync:latest
_config_path=public.yaml    # Path to config file in your repository
_env_path=.env              # .env file with secret keys and stuff
_volume="$(realpath .)"     # Path Docker will mount at $_mountpoint
_mountpoint=/config         # Mountpoint for your config directory

# Test changes:
docker run --rm -v "${_volume}":${_mountpoint} \
--env-file ${_env_path} ${_image} ${_mountpoint#/}/${_config_path}

# Really do it:
docker run --rm -v "${_volume}":${_mountpoint} \
--env-file ${_env_path} ${_image} ${_mountpoint#/}/${_config_path} --doit

octodns-sync's People

Contributors

antonydevanchi avatar solvaholic avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.