Skip to content

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

Notifications You must be signed in to change notification settings

kamalalnabrissi2017/cloudflare-dns-action

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

About

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

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Makefile 68.2%
  • HCL 12.5%
  • Shell 12.0%
  • Dockerfile 7.3%