-
-
Notifications
You must be signed in to change notification settings - Fork 1
98 lines (83 loc) · 2.54 KB
/
dnscontrol.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
name: DNSControl
on:
push:
branches:
- main
paths:
- 'dnsconfig.js'
- '.github/workflows/dnscontrol.yml'
- 'creds.example.json'
workflow_dispatch:
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
PORKBUN_API_KEY: ${{ secrets.PORKBUN_API_KEY }}
PORKBUN_API_SECRET: ${{ secrets.PORKBUN_API_SECRET }}
SLACK_WEBHOOK_URL: ${{ secrets.SLACK_WEBHOOK_URL }}
CONFIG_FILE: 'dnsconfig.js'
CREDS_FILE: 'creds.example.json'
jobs:
dnscontrol-check:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Check
id: dnscontrol_check
uses: is-cool-me/[email protected]
with:
args: check
config_file: 'dnsconfig.js'
creds_file: 'creds.example.json'
dnscontrol-preview:
runs-on: ubuntu-latest
needs: dnscontrol-check
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Preview
id: dnscontrol_preview
uses: is-cool-me/[email protected]
with:
args: preview --notify
config_file: 'dnsconfig.js'
creds_file: 'creds.example.json'
dnscontrol-push:
runs-on: ubuntu-latest
needs: dnscontrol-preview
permissions:
contents: write
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get Date
id: get_date
run: echo "REPORT_DATE=$(date +'%Y-%m-%d')" >> $GITHUB_ENV
- name: Get File Name
id: get_file_name
env:
REPORT_DATE: ${{ env.REPORT_DATE }}
run: echo "REPORT_FILE=./reports/$REPORT_DATE-Report.txt" >> $GITHUB_ENV
- name: Test Echo Date
env:
REPORT_DATE: ${{ env.REPORT_DATE }}
REPORT_FILE: ${{ env.REPORT_FILE }}
run: |
echo "$REPORT_DATE"
echo "$REPORT_FILE"
- name: Push
id: dnscontrol_push
uses: is-cool-me/[email protected]
env:
REPORT_DATE: ${{ env.REPORT_DATE }}
REPORT_FILE: ${{ env.REPORT_FILE }}
with:
args: push --notify --report $REPORT_FILE
config_file: 'dnsconfig.js'
creds_file: 'creds.example.json'
- name: Commit and Push Changes
id: git_commit_push
uses: stefanzweifel/git-auto-commit-action@v5
with:
commit_user_email: 'github-actions[bot]@users.noreply.github.com'
commit_user_name: 'github-actions[bot]'
commit_message: 'chore: github action dnscontrol - $REPORT_DATE'