Skip to content

Update

Update #948

Workflow file for this run

name: Update
on:
workflow_dispatch:
inputs:
zonedbArgs:
description: 'zonedb arguments'
required: false
default: ''
schedule:
- cron: "07 8 * * *" # 08:07 UTC, or 12:07 AM PT
jobs:
update:
name: Update ZoneDB
runs-on: ubuntu-22.04
timeout-minutes: 60
steps:
- name: Checkout repo
uses: actions/checkout@v3.5.2
with:
token: ${{ secrets.ZONEDBOT_RW_GITHUB_ACCESS_TOKEN }}
submodules: recursive
- name: Set up Go
uses: actions/setup-go@v4.0.0
with:
go-version: ^1
- name: Update ZoneDB
env:
ZONEDB_ARGS: ${{ github.event.inputs.zonedbArgs }}
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 config --global user.email robot@zonedb.org
git config --global user.name zonedbot
git add -v --all .
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 }}