-
Notifications
You must be signed in to change notification settings - Fork 2
49 lines (41 loc) · 1.32 KB
/
update-data.yaml
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
name: update-data
on:
schedule:
- cron: '42 0 * * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v1
- name: Update ICANN
run: bin/update_icann.sh
- name: Update PublicSuffixList
run: bin/update_publicsuffix.sh
- name: Install SSH Client
uses: webfactory/ssh-agent@v0.4.1
with:
ssh-private-key: ${{ secrets.DEPLOY_KEY }}
- name: Prepare git and github
run: |
git config --global user.email "github-action@github.com"
git config --global user.name "Github Action"
git remote add deploy git@github.com:redirect2me/resolvers.git
git checkout main
- name: Commit changes
run: bin/data-commit.sh
- name: Notify NodePing
env:
NODEPING_CHECKTOKEN: ${{ secrets.NODEPING_UPDATEDATA_CHECKTOKEN }}
NODEPING_ID: ${{ secrets.NODEPING_UPDATEDATA_ID }}
if: ${{ github.event_name == 'schedule' }}
run: |
if [ "${NODEPING_CHECKTOKEN}" != "" ] && [ "${NODEPING_ID}" != "" ]; then
curl \
--silent \
--request POST \
"https://push.nodeping.com/v1?id=${NODEPING_ID}&checktoken=${NODEPING_CHECKTOKEN}"
else
echo "WARNING: nodeping not configured for update-data"
fi