mirror of
https://github.com/mahdibland/V2RayAggregator.git
synced 2026-06-03 21:01:49 +08:00
56 lines
1.7 KiB
YAML
56 lines
1.7 KiB
YAML
name: sub_merge
|
|
|
|
# 触发条件
|
|
on:
|
|
workflow_dispatch:
|
|
|
|
schedule:
|
|
# - cron: '*/5 * * * *'
|
|
# 表达式生成 https://crontab.guru/
|
|
- cron: "0 0,12 * * *"
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v2
|
|
- name: Install Python
|
|
uses: actions/setup-python@v2
|
|
with:
|
|
python-version: "3.x"
|
|
- name: Load Cache
|
|
uses: actions/cache@v2
|
|
with:
|
|
path: ~/.cache/pip
|
|
key: ${{ runner.os }}-pip-${{ hashFiles('**/run_in_Actions/requirements.txt') }}
|
|
restore-keys: |
|
|
${{ runner.os }}-pip-
|
|
- name: Set Timezone
|
|
run: sudo timedatectl set-timezone 'Asia/Tehran'
|
|
- name: Install Requirements
|
|
run: |
|
|
pip install -r ./utils/requirements.txt
|
|
- name: Running Tasks
|
|
run: |
|
|
wget -O subconverter.tar.gz https://github.com/tindy2013/subconverter/releases/download/v0.7.2/subconverter_linux64.tar.gz
|
|
tar -zxvf subconverter.tar.gz -C ./
|
|
chmod +x ./subconverter/subconverter && nohup ./subconverter/subconverter >./subconverter.log 2>&1 &
|
|
|
|
python ./utils/list_merge.py
|
|
|
|
- name: Commit Changes
|
|
run: |
|
|
git config --local user.email "actions@github.com"
|
|
git config --local user.name "GitHub Actions"
|
|
git pull origin master
|
|
git add ./sub
|
|
git add ./utils/Country.mmdb
|
|
git add README.md
|
|
git checkout master
|
|
git commit -m "$(date '+%Y-%m-%d %H:%M:%S') Update Nodes"
|
|
- name: Push Changes
|
|
uses: ad-m/github-push-action@master
|
|
with:
|
|
branch: master
|