mirror of
https://github.com/gaoyifan/china-operator-ip.git
synced 2025-12-16 06:13:15 +08:00
52 lines
1.3 KiB
YAML
52 lines
1.3 KiB
YAML
name: Build
|
|
|
|
on:
|
|
push:
|
|
branches: [ '*' ]
|
|
pull_request:
|
|
branches: [ '*' ]
|
|
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: '45 2 * * *'
|
|
|
|
jobs:
|
|
build:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
BGPTOOLS_VERSION: 0.2.2
|
|
steps:
|
|
- uses: actions/checkout@v3
|
|
- uses: dtolnay/rust-toolchain@stable
|
|
- uses: cargo-bins/cargo-binstall@main
|
|
- run: sudo apt-get install -y tree jq axel
|
|
- uses: actions/cache@v3
|
|
with:
|
|
key: ${{ runner.os }}-build-dependencies
|
|
path: |
|
|
~/.cargo/bin
|
|
- run: ./dependency.sh
|
|
- uses: nick-fields/retry@v3
|
|
with:
|
|
timeout_minutes: 60
|
|
max_attempts: 3
|
|
command: ./generate.sh
|
|
- run: ./stat.sh
|
|
- run: ./guard.sh
|
|
- name: Checkout ip-lists branch
|
|
uses: actions/checkout@v3
|
|
if: github.event_name == 'schedule' && github.ref == 'refs/heads/master'
|
|
with:
|
|
ref: ip-lists
|
|
path: ip-lists
|
|
- run: ./upload.sh
|
|
if: github.event_name == 'schedule' && github.ref == 'refs/heads/master'
|
|
- name: Refresh CDN cache
|
|
if: github.event_name == 'schedule' && github.ref == 'refs/heads/master'
|
|
run: |
|
|
cd ip-lists
|
|
for file in *; do
|
|
curl -i "https://purge.jsdelivr.net/gh/${{ github.repository }}@ip-lists/${file}"
|
|
done
|
|
|