anti-AD/.github/workflows/sync-to-dist.yml

45 lines
1.3 KiB
YAML
Raw Normal View History

2020-02-02 22:07:17 +08:00
name: sync list to dist
2020-02-03 11:49:35 +08:00
on:
2020-02-20 10:52:17 +08:00
schedule:
- cron: "16 13 */6 * *"
2020-02-03 11:49:35 +08:00
push:
2020-02-12 10:58:24 +08:00
branches:
- 'master'
2020-02-03 11:49:35 +08:00
paths:
2020-02-03 11:55:51 +08:00
- 'anti-ad-*.txt'
2020-02-28 13:01:00 +08:00
- 'anti-ad-*.conf'
2020-02-03 11:49:35 +08:00
- 'adblock-for-dnsmasq.conf'
2020-02-02 22:07:17 +08:00
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
2020-02-03 10:45:02 +08:00
- name: clone the website
2020-07-21 22:53:09 +08:00
run: git clone https://github.com/privacy-protection-tools/anti-ad.github.io.git ~/website
2020-02-03 10:45:02 +08:00
- name: copy some list files
run: |
2020-07-21 22:53:09 +08:00
cp ./anti-ad-easylist.txt ~/website/docs/easylist.txt
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-domains.txt ~/website/docs/domains.txt
2020-02-03 10:45:02 +08:00
- name: Commit files
run: |
cd ~/website
git config --local user.email "action@github.com"
git config --local user.name "GitHub Action"
2020-02-03 13:34:59 +08:00
git add .
2020-02-03 10:45:02 +08:00
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'
2020-02-03 11:08:06 +08:00
directory: '/home/runner/website'
2020-07-21 22:53:09 +08:00
repository: 'privacy-protection-tools/anti-ad.github.io'