mirror of
https://github.com/koenrh/dnscontrol-action.git
synced 2025-01-10 00:59:22 +08:00
Merge pull request #17 from koenrh/koenrh/update-examples
Update examples
This commit is contained in:
commit
3648c3c572
4 changed files with 54 additions and 34 deletions
|
@ -1,8 +1,6 @@
|
|||
# Examples
|
||||
|
||||
Find in [main.workflow](main.workflow) an example workflow:
|
||||
Find in this folder two GitHub Actions workflow examples.
|
||||
|
||||
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.
|
||||
* [deploy-master.yml](deploy-master.yml): On merge into master, deploy the DNS configuration.
|
||||
* [test-pull-request.yml](test-pull-request.yml): Lint the `dnsconfig.js` configuration file using ESLint, and preview the DNS changes.
|
||||
|
|
21
examples/deploy-master.yml
Normal file
21
examples/deploy-master.yml
Normal file
|
@ -0,0 +1,21 @@
|
|||
---
|
||||
name: deploy
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
dnscontrol:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: DNSControl push
|
||||
uses: koenrh/dnscontrol-action@master
|
||||
env:
|
||||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
|
||||
CLOUDFLARE_API_USER: ${{ secrets.CLOUDFLARE_API_USER }}
|
||||
with:
|
||||
args: push
|
|
@ -1,29 +0,0 @@
|
|||
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"]
|
||||
}
|
30
examples/test-pull-request.yml
Normal file
30
examples/test-pull-request.yml
Normal file
|
@ -0,0 +1,30 @@
|
|||
---
|
||||
name: Test
|
||||
|
||||
on: pull_request
|
||||
|
||||
jobs:
|
||||
eslint:
|
||||
name: ESLint
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Run ESLint
|
||||
uses: koenrh/actions/eslint@master
|
||||
with:
|
||||
args: dnsconfig.js
|
||||
|
||||
dnscontrol:
|
||||
name: DNSControl
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@master
|
||||
|
||||
- name: Preview
|
||||
uses: koenrh/dnscontrol-action@master
|
||||
env:
|
||||
CLOUDFLARE_API_KEY: ${{ secrets.CLOUDFLARE_API_KEY }}
|
||||
CLOUDFLARE_API_USER: ${{ secrets.CLOUDFLARE_API_USER }}
|
||||
with:
|
||||
args: preview
|
Loading…
Reference in a new issue