Update DB #203
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Update DB | |
on: | |
repository_dispatch: | |
workflow_dispatch: | |
schedule: | |
- cron: "0 1 */3 * *" | |
jobs: | |
run: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Download GeoLite.mmdb | |
run: | | |
wget -nv -O GeoLite2-Country.tar.gz "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-Country&license_key=${{ secrets.LICENSE_KEY }}&suffix=tar.gz" | |
NAME=$(tar --exclude="*/*" -tf ./GeoLite2-Country.tar.gz | sed 's/.$//') | |
echo $NAME | sed 's/^/NAME=/' >> $GITHUB_ENV | |
- name: Push to git | |
run: | | |
git init -b download | |
git config user.name "${{ github.actor }}" | |
git config user.email "${{ github.actor }}@users.noreply.github.com" | |
git add . | |
git commit -m "${{ env.NAME }}" | |
git remote add origin "https://${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}@github.com/${{ github.repository }}" | |
git push -f origin download |