Skip to content

Cron

Cron #1597

Workflow file for this run

name: Cron
on:
schedule:
# * is a special character in YAML so you have to quote this string
- cron: '0 0 * * *'
jobs:
release:
runs-on: ${{ matrix.os }}
strategy:
matrix:
os: [ubuntu-latest]
node-version: [22]
steps:
- name: Fetch repository
uses: actions/checkout@v4
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v4
with:
node-version: ${{ matrix.node-version }}
- name: Get yarn cache directory path
id: yarn-cache-dir-path
run: echo "dir=$(yarn cache dir)" >> $GITHUB_OUTPUT
- uses: actions/cache@v4
id: yarn-cache # use this to check for `cache-hit` (`steps.yarn-cache.outputs.cache-hit != 'true'`)
with:
path: ${{ steps.yarn-cache-dir-path.outputs.dir }}
key: ${{ runner.os }}-yarn-${{ hashFiles('**/yarn.lock') }}
restore-keys: |
${{ runner.os }}-yarn-
- name: yarn install, generate
run: |
yarn install
yarn gen-domain-set
- name: commit, push
uses: EndBug/add-and-commit@v9
with:
add: 'domain-set'
author_name: Roy Li
author_email: [email protected]
message: 'auto update'
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare files
run: |
mkdir -p ./rule-set
cp ./*.list ./rule-set/
- name: Upload files P1
uses: geekdada/ossutil-github-action@master
with:
ossArgs: 'sync --delete -u -f ./domain-set oss://dada-oss/github/surge-list/domain-set'
accessKey: ${{ secrets.ALIYUN_ACCESS_KEY }}
accessSecret: ${{ secrets.ALIYUN_ACCESS_SECRET }}
endpoint: oss-accelerate.aliyuncs.com
- name: Upload files P2
uses: geekdada/ossutil-github-action@master
with:
ossArgs: 'sync --delete -u -f ./rule-set oss://dada-oss/github/surge-list/rule-set'
accessKey: ${{ secrets.ALIYUN_ACCESS_KEY }}
accessSecret: ${{ secrets.ALIYUN_ACCESS_SECRET }}
endpoint: oss-accelerate.aliyuncs.com