anti-AD/.github/workflows/auto-rebuild.yml

50 lines
1.6 KiB
YAML
Raw Normal View History

2021-05-28 21:03:53 +08:00
# This is a basic workflow to help you get started with Actions
name: Auto rebuild anti-AD list
# Controls when the action will run.
on:
# Triggers the workflow on push or pull request events but only for the master branch
push:
2021-05-29 08:30:00 +08:00
branches: [ adlist-maker ]
2021-05-28 21:03:53 +08:00
# Allows you to run this workflow manually from the Actions tab
workflow_dispatch:
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
2021-05-29 08:32:45 +08:00
- name: co master
2021-05-29 00:46:49 +08:00
uses: actions/checkout@v2
with:
2021-05-29 08:32:45 +08:00
ref: 'master'
2021-05-28 21:03:53 +08:00
# Runs a set of commands using the runners shell
2021-05-29 00:31:36 +08:00
- name: Run
2021-05-28 21:03:53 +08:00
run: |
2021-05-29 00:53:15 +08:00
git config --global user.email "action@github.com"
git config --global user.name "GitHub Action[bot]"
2021-05-29 00:38:49 +08:00
sudo update-alternatives --set php /usr/bin/php7.4
2021-05-29 08:30:00 +08:00
git checkout adlist-maker
2021-05-29 00:37:33 +08:00
/bin/bash ./scripts/build-list.sh
2021-05-29 00:31:36 +08:00
git stash -u
2021-05-29 08:32:45 +08:00
git checkout master
2021-05-29 00:31:36 +08:00
git checkout stash@{0}^3 -- adblock-for-dnsmasq.conf
git checkout stash@{0}^3 -- anti-ad-*
git add *
git commit -am "Auto renew the anti-AD list."
git stash clear
- name: push
uses: ad-m/github-push-action@master
with:
github_token: ${{ secrets.PERSON_TOKEN }}
2021-05-29 08:32:45 +08:00
branch: 'master'
2021-05-29 00:31:36 +08:00