-
Notifications
You must be signed in to change notification settings - Fork 38
79 lines (67 loc) · 2.39 KB
/
update.yaml
File metadata and controls
79 lines (67 loc) · 2.39 KB
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
name: Data Update
on:
workflow_dispatch:
inputs:
zonedbArgs:
description: "zonedb arguments"
required: false
default: "-verify-whois -verify-ns"
schedule:
- cron: "07 8 * * *" # 08:07 UTC, or 12:07 AM PT
concurrency:
group: update-${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
update:
name: Update ZoneDB
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout repo
uses: actions/checkout@v6
with:
token: ${{ secrets.ZONEDBOT_RW_GITHUB_ACCESS_TOKEN }}
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v6
with:
go-version: "stable"
- name: Get go dependencies
run: go get -t ./...
# Primary key is unique per run, so restore falls back to the latest
# etag-cache- prefix match and saves a new run-specific snapshot.
- name: Restore ETag cache
uses: actions/cache@v5
with:
path: .cache/
key: etag-cache-${{ github.run_id }}
restore-keys: |
etag-cache-
- name: Update ZoneDB
env:
# Default to the workflow_dispatch input's default for scheduled runs.
ZONEDB_ARGS: ${{ github.event.inputs.zonedbArgs || '-verify-whois -verify-ns' }}
# Temporary NS flap diagnostics; remove once the root cause is found.
ZONEDB_DEBUG_NS: "1"
ZONEDB_DEBUG_NS_SUFFIX: "рус"
run: make update
- name: Vet Go code
run: go vet ./...
- name: Run Go tests
run: go test -mod=readonly -v -race ./...
- name: Commit changes
run: |
[[ -z $(git status -s) ]] || ( git add -v --all .
git config --global user.email robot@zonedb.org
git config --global user.name zonedbot
git commit -m "Automatic update for $(date -u)"
git push origin -u HEAD
)
- name: Notify if failure
if: ${{ failure() }}
run: |
curl -Ss -X POST -H 'Content-type: application/json' --data '{"text":"❌ ZoneDB update failed."}' ${{ secrets.SLACK_WEBHOOK_URL_GH_ACTIONS }}
# - name: Notify if success
# if: ${{ success() }}
# run: |
# curl -Ss -X POST -H 'Content-type: application/json' --data '{"text":"✅ ZoneDB updated."}' ${{ secrets.SLACK_WEBHOOK_URL_GH_ACTIONS }}