From 00bfe92067d011d76eeca7e819abd3677c2bd314 Mon Sep 17 00:00:00 2001 From: Eran Raichstein Date: Sun, 6 Mar 2022 16:05:07 +0200 Subject: [PATCH] update location db --- .github/workflows/update_location_db.yml | 34 ++++++++++++++++++++++++ 1 file changed, 34 insertions(+) create mode 100644 .github/workflows/update_location_db.yml diff --git a/.github/workflows/update_location_db.yml b/.github/workflows/update_location_db.yml new file mode 100644 index 000000000..26e93edec --- /dev/null +++ b/.github/workflows/update_location_db.yml @@ -0,0 +1,34 @@ +name: update location db + +on: + schedule: + - cron: '00 00 * * *' + +env: + DB_TOKEN_SECRET: ${{ secrets.LOCATION_DB_TOKEN_SECRET }} + +jobs: + execute: + name: update location db + runs-on: ubuntu-latest + steps: + - name: checkout + uses: actions/checkout@v2 + with: + persist-credentials: false + fetch-depth: 0 + - name: update + run: | + wget --spider "https://www.ip2location.com/download/?token=$DB_TOKEN_SECRET&file=DB9LITEBIN" -O contrib/location/location.db + - name: commit + run: | + ls -la contrib/location/location.db + git config user.name github-actions + git config user.email github-actions@github.com + git commit -am "update location DB" + - name: push + uses: ad-m/github-push-action@master + with: + github_token: ${{ secrets.UPDATE_LOCATION_GITHUB_TOKEN }} + branch: main +