Add Rules to Cloudflare Gateway #472
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: Add Rules to Cloudflare Gateway | |
on: | |
push: | |
schedule: | |
- cron: "0 * * * *" | |
workflow_dispatch: | |
jobs: | |
run: | |
name: Cloudflare Gateway | |
permissions: write-all | |
runs-on: ubuntu-latest | |
timeout-minutes: 15 | |
env: | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
CF_API_TOKEN: ${{ secrets.CF_API_TOKEN }} | |
CF_IDENTIFIER: ${{ secrets.CF_IDENTIFIER }} | |
ADLIST_URLS: ${{ vars.ADLIST_URLS }} | |
WHITELIST_URLS: ${{ vars.WHITELIST_URLS }} | |
DYNAMIC_BLACKLIST: ${{ vars.DYNAMIC_BLACKLIST }} | |
DYNAMIC_WHITELIST: ${{ vars.DYNAMIC_WHITELIST }} | |
steps: | |
- name: Checkout Repository | |
uses: actions/checkout@main | |
with: | |
fetch-depth: 0 | |
- name: Install Python | |
uses: actions/setup-python@main | |
with: | |
python-version: 3.11 | |
- name: Cache Data | |
id: cache-cloudflare | |
uses: actions/cache@main | |
with: | |
path: cloudflare_cache.json | |
key: ${{ runner.os }}-cloudflare-cache-${{ github.run_id }} | |
restore-keys: | | |
${{ runner.os }}-cloudflare-cache- | |
- name: Cloudflare Gateway Zero Trust | |
run: python -m src run |