Add workflow that automatically update cached mmdb files

This commit is contained in:
Théophile Diot 2023-04-30 09:11:12 +02:00
parent d4ceb7c106
commit c3d0d7ca70
No known key found for this signature in database
GPG Key ID: E752C80DB72BB014
1 changed files with 33 additions and 0 deletions

33
.github/workflows/dev-update-mmdb.yml vendored Normal file
View File

@ -0,0 +1,33 @@
name: Update cached mmdb files
permissions:
contents: write
on:
workflow_dispatch:
schedule:
- cron: "0 1 5 * *"
jobs:
mmdb-update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Download mmdb files
run: |
mkdir -p src/bw/misc/
cd src/bw/misc/
curl -s -o asn.mmdb.gz https://download.db-ip.com/free/dbip-asn-lite-$(date +%Y-%m).mmdb.gz
curl -s -o country.mmdb.gz https://download.db-ip.com/free/dbip-country-lite-$(date +%Y-%m).mmdb.gz
rm -f asn.mmdb country.mmdb
gunzip asn.mmdb.gz
gunzip country.mmdb.gz
- name: Commit and push changes
uses: stefanzweifel/git-auto-commit-action@v4
with:
branch: dev
commit_message: "Monthly mmdb update"
commit_options: "--no-verify"
commit_user_name: "GitHub Actions"
commit_user_email: "tdiot@bunkerity.com"