Sync Country.mmdb File #29
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: Sync Country.mmdb File | |
on: | |
schedule: | |
- cron: '0 10 * * *' # 每天北京时间下午6点触发 | |
workflow_dispatch: # 可以手工触发 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout your repository | |
uses: actions/checkout@v4 | |
- name: Download file | |
run: | | |
echo "Start downloading Country.mmdb..." | |
curl -L --retry 3 --retry-delay 5 --connect-timeout 10 \ | |
https://raw.githubusercontent.com/Masaiki/GeoIP2-CN/release/Country.mmdb \ | |
-o Common/Country.mmdb | |
echo "File download completed." | |
- name: Commit and push changes | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
git config --global user.name 'cngzsunny' | |
git config --global user.email '[email protected]' | |
git add Common/Country.mmdb | |
git commit -m "Sync Country.mmdb" || echo "No changes detected, skipping commit." | |
BRANCH=$(git rev-parse --abbrev-ref HEAD) | |
git push https://x-access-token:${GITHUB_TOKEN}@github.com/cngzsunny/vpn_tool.git $BRANCH |