-
Notifications
You must be signed in to change notification settings - Fork 0
25 lines (25 loc) · 1018 Bytes
/
main.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
name: verify DB update
on:
push:
branches: [ "main" ]
schedule:
- cron: '0 0 * * 1'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: New DB check
run: |
cd ${{github.workspace}}
rm -rf *.mmdb.gz
wget "https://download.db-ip.com/free/dbip-city-lite-$(date +"%Y")-$(date +"%m").mmdb.gz"
if [ $? -ne 0 ]; then echo "monthly update not occurred yet"; git checkout city.mmdb.gz; git checkout asn.mmdb.gz; exit 0; fi
gzip -d dbip*; mv dbip* city.mmdb; gzip city.mmdb
wget "https://download.db-ip.com/free/dbip-asn-lite-$(date +"%Y")-$(date +"%m").mmdb.gz"
if [ $? -ne 0 ]; then echo "monthly update not occurred yet"; git checkout city.mmdb.gz; git checkout asn.mmdb.gz; exit 0; fi
gzip -d dbip*; mv dbip* asn.mmdb; gzip asn.mmdb
- name: commit changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
commit_message: update last check