Skip to content
cloud

GitHub Action

Cloudflare DNS

1.0.0 Latest version

Cloudflare DNS

cloud

Cloudflare DNS

Update or Create DNS record on cloudlfare

Installation

Copy and paste the following snippet into your .yml file.

              

- name: Cloudflare DNS

uses: xorilog/[email protected]

Learn more about this action in xorilog/cloudflare-dns-action

Choose a version

Cloudflare DNS GitHub Action

Build Status

A GitHub action to set a Cloudflare DNS record on push to the master branch.

workflow "on push to master, adjust domain on Cloudflare" {
  on = "push"
  resolves = ["set cloudflare dns record"]
}

action "set cloudflare dns record" {
  uses = "xorilog/cloudflare-dns-action@master"
  env = {
    RECORD_DOMAIN = "site.example.com",
    RECORD_TYPE = "A",
    RECORD_VALUE = "192.168.0.11",
    RECORD_NAME = "terraform",
    RECORD_TTL = "1",
  }
  secrets = [ "CLOUDFLARE_EMAIL", "CLOUDFLARE_TOKEN" ]
}

Heavily inspired by Jessie Frazelle's aws-fargate-action and Chris Pilsworth cloudflare-worker-action GitHub action project. 🏆

Tests

The tests use shellcheck. You don't need to install anything. They run in a container.

$ make test

Using the Makefile

$ make help
cf-apply                      Run terraform apply for Amazon.
cf-destroy                    Run terraform destroy for Amazon.
cf-plan                       Run terraform plan for Amazon.
shellcheck                     Runs the shellcheck tests on the scripts.
test                           Runs the tests on the repository.
update-terraform               Update terraform binary locally from the docker container.
update                         Update terraform binary locally.