-
Notifications
You must be signed in to change notification settings - Fork 133
76 lines (66 loc) · 2.39 KB
/
main.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
# This is a basic workflow to help you get started with Actions
name: update
# Controls when the action will run. Triggers the workflow on push or pull request
on:
schedule:
#- cron: "30 0 * * 1/2"
- cron: "30 0 * * 1"
#push:
#branches:
#- master
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
# Runs a single command using the runners shell
- name: Set up Python 3.7
uses: actions/setup-python@v2
with:
python-version: '3.x'
# 安装依赖
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install requests wget
# 更新
- name: update profile
run: |
cd factory
python MainWork.py
#提交更新
- name: commit
run: |
git config --global user.email ${USER_EMAIL}
git config --global user.name ${USER_NAME}
git add .
git commit -m "程序自动更新规则" -a
env:
USER_EMAIL: ${{ secrets.USER_EMAIL }}
USER_NAME: ${{ secrets.USER_NAME }}
#推送更新至github
- name: Push changes
uses: ad-m/github-push-action@master
with:
GITHUB_TOKEN: ${{ secrets.PUSH_TOKEN }}
# #推送更新至gitee
# - name: Mirror the Github organization repos to Gitee.
# uses: wearerequired/git-mirror-action@master
# env:
# SSH_PRIVATE_KEY: ${{ secrets.GITEE_PRIVATE_KEY }}
# with:
# source-repo: "git@github.com:zqzess/rule_for_quantumultX.git"
# destination-repo: "git@gitee.com:zqzess/rule_for_quantumult-x.git"
#微信推送更新信息
- name: Send Failed Message
if: failure()
#run: wget https://sc.ftqq.com/${USER_KEY}.send?text=圈X配置文件更新出错!
run: wget https://sctapi.ftqq.com/${USER_KEY}.send?title=更新错误&desp=圈X配置文件更新出错
env:
USER_KEY: ${{secrets.USER_KEY}}