maxmind-geoip/.github/workflows/crontab.yml

44 lines
1.3 KiB
YAML

name: Weekly Build
on:
workflow_dispatch:
schedule:
- cron: 0 22 * * FRI
jobs:
build:
name: Pull and Release
runs-on: ubuntu-latest
steps:
- name: Set variables
run: |
echo "tag=$(date +%Y%m%d)" >> $GITHUB_ENV
shell: bash
- name: Download file
env:
LICENSE_KEY: ${{ secrets.LICENSE_KEY }}
run: |
wget -O ./GeoLite2-Country.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${LICENSE_KEY}&suffix=tar.gz"
tar zxvf ./GeoLite2-Country.tar.gz -C .
mv ./GeoLite2-Country_*/GeoLite2-Country.mmdb ./Country.mmdb
- name: Upload Release
uses: softprops/action-gh-release@v1
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
with:
files: Country.mmdb
tag_name: ${{ env.tag }}
- name: Git push assets to "release" branch
run: |
git init
git config --local user.name "actions"
git config --local user.email "action@github.com"
git checkout -b release
git add Country.mmdb
git commit -m "${{ env.tag }}"
git remote add publish https://x-access-token:${{ secrets.GITHUB_TOKEN }}@github.com/$GITHUB_REPOSITORY
git push -f publish release