Cron Task #486
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
# This workflow will install Python dependencies, run tests and lint with a single version of Python | |
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python | |
name: Cron Task | |
concurrency: | |
group: release | |
cancel-in-progress: true | |
on: | |
schedule: | |
- cron: "15 0/24 * * *" | |
push: | |
branches: [ "main" ] | |
pull_request: | |
branches: [ "main" ] | |
permissions: | |
contents: write | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/checkout@v4 | |
with: | |
github-server-url: 'https://github.com' | |
repository: 'v2fly/domain-list-community' | |
path: 'v2fly-dataset' | |
- uses: actions/setup-go@v4 | |
with: | |
go-version: "1.22" | |
- uses: actions/setup-python@v4 | |
id: cp312 | |
with: | |
python-version: "3.12" | |
- name: Setup env Python | |
run: | | |
python -m pip install --upgrade pip httpx | |
- name: Setup env | |
run: | | |
cd v2fly-dataset | |
go run ./ -exportlists "category-ads-all,cn,geolocation-!cn" -outputdir $GITHUB_WORKSPACE | |
- name: Run Workflows | |
run: | | |
python .github/scripts/setup_adguard.py | |
python .github/scripts/setup_v2fly.py | |
- name: Git Push | |
shell: bash | |
run: | | |
git config --local user.name "github-actions[bot]" | |
git config --local user.email "41898282+github-actions[bot]@users.noreply.github.com" | |
git add ruleset-*.conf | |
if [[ `git status --porcelain` ]]; then | |
git commit -m "ci: auto-build" | |
git push | |
else | |
echo "WARNING: No changes were detected." | |
fi |