Skip to content

xorilog/cloudflare-dns-action

Use this GitHub action with your project
Add this Action to an existing workflow or create a new one
View on Marketplace

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.