Create upload.yml

This commit is contained in:
manhduonghn 2023-08-20 17:20:24 +07:00 committed by GitHub
parent 541dd9d665
commit f030410e60
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 41 additions and 0 deletions

41
.github/workflows/upload.yml vendored Normal file
View File

@ -0,0 +1,41 @@
name: Add Rules to Cloudflare Gateway
on:
workflow_dispatch:
jobs:
run:
name: Cloudflare Gateway
permissions: write-all
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: Install Python
uses: actions/setup-python@v4
with:
python-version: 3.11.3
- name: Install Dependencies
run: pip install -r requirements.txt
- name: Set up Environment Variables
env:
CLOUDFLARE_TOKEN: ${{ secrets.CLOUDFLARE_TOKEN }}
CLOUDFLARE_ACCOUNT_ID: ${{ secrets.CLOUDFLARE_ACCOUNT_ID }}
- name: Delete Older Rules
run: python -m src delete
- name: Upload New Rules
run: python -m src upload
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
token: ${{ github.token }}
repository: ${{ github.repository }}
retain_days: 0
keep_minimum_runs: 1