From 576cfc40e3e3cd3e31a83a19a232411ce1ad6743 Mon Sep 17 00:00:00 2001 From: Koen Rouwhorst Date: Sat, 5 Jan 2019 15:44:13 +0100 Subject: [PATCH 1/2] Added example workflow. --- examples/main.workfow | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) create mode 100644 examples/main.workfow diff --git a/examples/main.workfow b/examples/main.workfow new file mode 100644 index 0000000..fe5c5ff --- /dev/null +++ b/examples/main.workfow @@ -0,0 +1,29 @@ +workflow "Deploy DNS" { + on = "push" + resolves = ["DNSControl push"] +} + +action "ESLint" { + uses = "koenrh/actions/eslint@4bd28abf67573a1b21b0efa07d2fbbc04b32c6af" + args = "dnsconfig.js" +} + +action "DNSControl preview" { + uses = "koenrh/dnscontrol-action@ec8e8a39a250ccb4368ce9de4888db9511b61740" + args = "preview" + needs = ["ESLint"] + secrets = ["CLOUDFLARE_API_USER", "CLOUDFLARE_API_KEY"] +} + +action "Branch filter" { + uses = "actions/bin/filter@b2bea0749eed6beb495a8fa194c071847af60ea1" + args = "branch master" + needs = ["DNSControl preview"] +} + +action "DNSControl push" { + uses = "koenrh/dnscontrol-action@ec8e8a39a250ccb4368ce9de4888db9511b61740" + needs = ["Branch filter"] + args = "push" + secrets = ["CLOUDFLARE_API_KEY", "CLOUDFLARE_API_USER"] +} From 6658fee096e1e00710744e56e38bb6945e161288 Mon Sep 17 00:00:00 2001 From: Koen Rouwhorst Date: Sat, 5 Jan 2019 16:18:17 +0100 Subject: [PATCH 2/2] Added examples README. --- examples/README.md | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 examples/README.md diff --git a/examples/README.md b/examples/README.md new file mode 100644 index 0000000..d623656 --- /dev/null +++ b/examples/README.md @@ -0,0 +1,8 @@ +# Examples + +Find in [main.workflow](main.workflow) an example workflow: + +1. Lint the `dnsconfig.js` configuration file using ESLint. +1. Preview the DNS changes. +1. Check whether the current branch is `master`, otherwise abort. +1. Deploy the DNS changes.