Blocklists Update #70
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: Blocklists Update | |
on: | |
schedule: | |
- cron: '0 */2 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
blocklists_update: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Python | |
id: setup_python | |
uses: actions/setup-python@v5 | |
with: | |
python-version: '3.13' | |
- name: Restore cached virtualenv | |
uses: actions/cache/restore@v4 | |
with: | |
key: venv-${{ runner.os }}-python-${{ steps.setup_python.outputs.python-version }} | |
path: .venv_blocklist | |
- name: Install necessary packages | |
run: | | |
if [ ! -d ".venv_blocklist" ]; then | |
python -m venv .venv_blocklist | |
source .venv_blocklist/bin/activate | |
pip install requests ipaddress geoip2 path | |
else | |
echo "Using cached virtualenv" | |
fi | |
echo "$PWD/.venv_blocklist/bin" >> $GITHUB_PATH | |
echo "VIRTUAL_ENV=$PWD/.venv_blocklist" >> $GITHUB_ENV | |
- name: Save cached virtualenv | |
uses: actions/cache@v4 | |
with: | |
key: venv-${{ runner.os }}-python-${{ steps.setup_python.outputs.python-version }} | |
path: .venv_blocklist | |
- name: Run blocklists update script | |
run: | | |
python blocklists_update.py | |
python blocklists_statistics.py | |
- name: Execute Git push script | |
shell: bash | |
run: | | |
chmod +x blocklists_git_push.sh | |
./blocklists_git_push.sh ${{ secrets.GITHUB_TOKEN }} |