Files
coredns.io/.github/workflows/sync.coredns.yml
T
2020-02-06 12:12:57 +00:00

43 lines
1.0 KiB
YAML

name: Sync CoreDNS Content
on:
schedule:
- cron: '4/12 * * * *'
jobs:
sync:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v2
-
name: Checkout CoreDNS
uses: actions/checkout@v2
with:
repository: coredns/coredns
path: .coredns
-
name: Cleanup
run: |
rm -rf public/*
-
name: Sync
run: |
make sync
-
name: Set up Git
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
git config user.name "coredns-auto-sync[bot]"
git config user.email "coredns-auto-sync[bot]@users.noreply.github.com"
git remote set-url origin https://x-access-token:${GITHUB_TOKEN}@github.com/${GITHUB_REPOSITORY}.git
-
name: Push
run: |
git add .
if output=$(git status --porcelain) && [ ! -z "$output" ]; then
git commit -m 'auto content sync'
git push
fi