You cannot select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
anti-AD/.github/workflows/sync-to-dist.yml

69 lines
2.5 KiB
YAML

name: sync list to dist
on:
push:
branches:
- 'master'
paths:
- 'anti-ad-**.*'
- 'adblock-for-dnsmasq.conf'
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4.1.1
- name: clone the website
run: git clone https://github.com/privacy-protection-tools/anti-ad.github.io.git ~/website
- name: Install sing-box
env:
DEBIAN_FRONTEND: noninteractive
run: |
sudo curl -fsSL https://sing-box.app/gpg.key -o /etc/apt/keyrings/sagernet.asc
sudo chmod a+r /etc/apt/keyrings/sagernet.asc
echo "deb [arch=`dpkg --print-architecture` signed-by=/etc/apt/keyrings/sagernet.asc] https://deb.sagernet.org/ * *" | sudo tee /etc/apt/sources.list.d/sagernet.list > /dev/null
sudo apt-get update
# Switch to stable version if sing-box 1.10.0 released
sudo apt-get install sing-box-beta
- name: Compile sing-box rule-set
run: |
sing-box rule-set convert --type adguard ./anti-ad-adguard.txt --output ./anti-ad-sing-box.srs
echo '========================================'
sha256sum ./anti-ad-sing-box.srs
echo '========================================'
- name: Copy some list files
run: |
cp ./anti-ad-easylist.txt ~/website/docs/easylist.txt
cp ./anti-ad-easylist.txt.md5 ~/website/docs/easylist.txt.md5
cp ./anti-ad-adguard.txt ~/website/docs/adguard.txt
cp ./anti-ad-adguard.txt.md5 ~/website/docs/adguard.txt.md5
cp ./adblock-for-dnsmasq.conf ~/website/docs/dnsmasq.conf
cp ./adblock-for-dnsmasq.conf ~/website/docs/anti-ad-for-dnsmasq.conf
cp ./anti-ad-smartdns.conf ~/website/docs/anti-ad-for-smartdns.conf
cp ./anti-ad-surge.txt ~/website/docs/surge.txt
cp ./anti-ad-surge2.txt ~/website/docs/surge2.txt
cp ./anti-ad-clash.yaml ~/website/docs/clash.yaml
cp ./anti-ad-domains.txt ~/website/docs/domains.txt
cp ./anti-ad-sing-box.srs ~/website/docs/anti-ad-sing-box.srs
- name: Commit files
run: |
cd ~/website
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
git add .
git commit -m "pull newest list." -a
- name: Push changes
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PERSON_TOKEN }}
branch: 'master'
directory: '/home/runner/website'
repository: 'privacy-protection-tools/anti-ad.github.io'