Skip to content

Update MaxMind GeoLite2 database #170

Update MaxMind GeoLite2 database

Update MaxMind GeoLite2 database #170

Workflow file for this run

name: "Update MaxMind GeoLite2 database"
on:
schedule:
- cron: "0 5 * * 2,5"
workflow_dispatch:
jobs:
build:
permissions: write-all
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Clean up
run: |
rm -rf ./dist/*/*
- name: Download
env:
BASE_URL: "https://download.maxmind.com/app/geoip_download"
LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: |
wget -O "GeoLite2-ASN.tar.gz" "${BASE_URL}?edition_id=GeoLite2-ASN&license_key=${LICENSE_KEY}&suffix=tar.gz"
wget -O "GeoLite2-City.tar.gz" "${BASE_URL}?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz"
wget -O "GeoLite2-Country.tar.gz" "${BASE_URL}?edition_id=GeoLite2-Country&license_key=${LICENSE_KEY}&suffix=tar.gz"
- name: Decompress
env:
SAVE_DIR: "./dist"
run: |
tar -zxvf "GeoLite2-ASN.tar.gz" -C "${SAVE_DIR}/GeoLite2-ASN" --strip-components 1
tar -zxvf "GeoLite2-City.tar.gz" -C "${SAVE_DIR}/GeoLite2-City" --strip-components 1
tar -zxvf "GeoLite2-Country.tar.gz" -C "${SAVE_DIR}/GeoLite2-Country" --strip-components 1
- name: Push
uses: EndBug/add-and-commit@v9
with:
add: "dist"