Refresh domain listing #898
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: Refresh domain listing | |
on: | |
schedule: | |
- cron: '22 1 * * *' | |
workflow_dispatch: | |
jobs: | |
refresh_domains: | |
name: Refresh domains | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout main | |
uses: actions/checkout@v2 | |
- uses: actions/setup-python@v3 | |
with: | |
python-version: '3.10' | |
- name: Install python dependencies | |
run: pip install -r requirements.txt | |
- name: Install apt dependencies | |
run: sudo apt install -y time | |
- name: Refresh domains listing | |
run: /usr/bin/time -v ./scripts/compile-domain-list.sh | |
- name: Count added domains | |
run: echo "added_count=$(wc -l public/lists/added.txt | cut -f 1 -d ' ')" >> $GITHUB_ENV | |
- name: Count deleted domains | |
run: echo "deleted_count=$(wc -l public/lists/deleted.txt | cut -f 1 -d ' ')" >> $GITHUB_ENV | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: "CI CRON: Update domain lists (${{ env.added_count }} added; ${{ env.deleted_count }} deleted)" | |
file_pattern: 'public/lists/*' |