Skip to content

Update GeoLite2 Database #13

Update GeoLite2 Database

Update GeoLite2 Database #13

Workflow file for this run

#
# https://github.com/P3TERX/GeoLite.mmdb
#
# File: .github/workflows/GeoLite.yml
# Description: Publish GeoLite.mmdb
#
# MIT License
#
# Copyright (c) 2021-2024 P3TERX <https://p3terx.com>
#
# Permission is hereby granted, free of charge, to any person obtaining a copy
# of this software and associated documentation files (the "Software"), to deal
# in the Software without restriction, including without limitation the rights
# to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
# copies of the Software, and to permit persons to whom the Software is
# furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in all
# copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
# AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
# OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
# SOFTWARE.
#
name: Update GeoLite2 Database
on:
schedule:
# Original repo runs at 02:00 UTC, so we'll run at 05:00 UTC
- cron: '0 5 */3 * *'
workflow_dispatch:
jobs:
update:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download GeoLite2 Databases
run: |
mkdir -p download
# Download from original repo's latest release
wget --content-disposition https://github.com/P3TERX/GeoLite.mmdb/releases/latest/download/GeoLite2-City.mmdb -O download/GeoLite2-City.mmdb
wget --content-disposition https://github.com/P3TERX/GeoLite.mmdb/releases/latest/download/GeoLite2-Country.mmdb -O download/GeoLite2-Country.mmdb
wget --content-disposition https://github.com/P3TERX/GeoLite.mmdb/releases/latest/download/GeoLite2-ASN.mmdb -O download/GeoLite2-ASN.mmdb
- name: Create Release
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
VERSION=$(date +%Y.%m.%d)
# Create release
gh release create ${VERSION} \
--title ${VERSION} \
--notes "GeoLite2 Database Update ${VERSION}" \
download/GeoLite2-ASN.mmdb \
download/GeoLite2-City.mmdb \
download/GeoLite2-Country.mmdb