forked from Limour-dev/daily_fudan
-
Notifications
You must be signed in to change notification settings - Fork 200
64 lines (55 loc) · 1.79 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
name: "Daily Fudan"
on:
schedule: # scheduled at (UTC+8) everyday
- cron: "23 20 * * *"
- cron: "24 6 * * *"
workflow_dispatch:
env:
# auto merge from y1ndan/genshin-impact-helper, default: false
ALLOW_MERGE: 'true'
RUN_ENV: 'prod'
TZ: 'Asia/Shanghai'
FUCK_GH_PAT: ${{ secrets.GH_PAT }}
jobs:
build:
runs-on: ubuntu-latest
# if: github.ref == 'refs/heads/master'
steps:
- name: Checkout master with GH_PAT
if: ${{ env.FUCK_GH_PAT }}
uses: actions/checkout@v2
with:
fetch-depth: 2
ref: master
token: ${{ secrets.GH_PAT }}
- name: Checkout master without GH_PAT
if: ${{ !env.FUCK_GH_PAT }}
uses: actions/checkout@v2
with:
fetch-depth: 0
ref: master
- name: Auto merge
if: ${{ env.ALLOW_MERGE != 'false' }}
run: |
git config --global user.name github-actions
git config --global user.email [email protected]
git config --global pull.rebase true
git remote add upstream https://github.com/Limourli-liu/daily_fudan.git
git config --global merge.ours.driver true
git pull upstream master --allow-unrelated-histories
git push origin master --force
- name: Set up python
uses: actions/setup-python@v2
with:
python-version: 3.9
- name: Random sleep
if: github.event_name == 'schedule'
run: sleep $(shuf -i 10-300 -n 1)
- name: Random_schedule
if: ${{ env.FUCK_GH_PAT }}
run: python3 ./random_schedule.py '${{ secrets.SCHEDULE }}'
- name: Run sign
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
python3 ./dailyFudan.py '${{ secrets.FUDAN }}'