update #314
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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}} |