Run Script #852
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: Run Script | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: execute py script | |
run: | | |
python get-china-ip.py | |
python get-google-ip-simple.py | |
git config --local user.email "[email protected]" | |
git config --local user.name "PikuZheng" | |
git add *-ip-ranges*.txt | |
git commit -m "generate new post from github action" -a | |
- name: push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# - uses: actions/upload-artifact@v3 | |
# with: | |
# name: "ip-ranges.zip" | |
# path: "*-ip-ranges*.txt" | |
build-china-operator-ip: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
ref: china-operator-ip | |
- uses: actions/setup-python@v2 | |
with: | |
python-version: 3.8 | |
- name: Install dependencies | |
run: | | |
python -m pip install --upgrade pip | |
pip install -r requirements.txt | |
- name: execute py script | |
run: | | |
python get-china-ip.py | |
git config --local user.email "[email protected]" | |
git config --local user.name "PikuZheng" | |
git add *-ip-ranges*.txt | |
git commit -m "generate new post from github action" -a | |
- name: push changes | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
branch: china-operator-ip | |
delete-old-runs: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Delete workflow runs | |
uses: Mattraks/delete-workflow-runs@v2 | |
with: | |
token: ${{ secrets.GITHUB_TOKEN }} | |
repository: ${{ github.repository }} | |
retain_days: 7 | |
keep_minimum_runs: 7 |