forked from vv314/actions-mtz-coupons
-
Notifications
You must be signed in to change notification settings - Fork 0
67 lines (58 loc) · 2.05 KB
/
grab-coupon.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
name: 领红包
# https://docs.github.com/cn/actions/reference/events-that-trigger-workflows#workflow_dispatch
on:
# 手动触发
workflow_dispatch:
# 定时任务
schedule:
# https://crontab.guru/
# UTC 时间,中国时区应减 8
# ┌────────── minute (0 - 59)
# │ ┌──────── hour (0 - 23)
# │ │ ┌────── day of the month (1 - 31)
# │ │ │ ┌──── month (1 - 12 or JAN-DEC)
# │ │ │ │ ┌── day of the week (0 - 6 or SUN-SAT)
# │ │ │ │ │
- cron: '45 2 * * *'
jobs:
start:
name: grab coupon
runs-on: ubuntu-latest
steps:
- name: Checkout codes
uses: actions/checkout@v3
- name: Setup Node.js
uses: actions/setup-node@v3
with:
node-version-file: 'package.json'
- uses: pnpm/action-setup@v2
name: Install pnpm
with:
run_install: false
- name: Get pnpm store directory
shell: bash
run: |
echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV
- uses: actions/cache@v3
name: Setup pnpm cache
with:
path: ${{ env.STORE_PATH }}
key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }}
restore-keys: |
${{ runner.os }}-pnpm-store-
- name: Install dependencies
run: pnpm install
- name: Run app
run: pnpm start
env:
TOKEN: ${{ secrets.TOKEN }}
BARK_KEY: ${{ secrets.BARK_KEY }}
TG_USER_ID: ${{ secrets.TG_USER_ID }}
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
SC_SEND_KEY: ${{ secrets.SC_SEND_KEY }}
QMSG_KEY: ${{ secrets.QMSG_KEY }}
QMSG_ADMIN: ${{ secrets.QMSG_ADMIN }}
QYWX_SEND_CONF: ${{ secrets.QYWX_SEND_CONF }}
LARK_WEBHOOK: ${{ secrets.LARK_WEBHOOK }}
PUSHPLUS_TOKEN: ${{ secrets.PUSHPLUS_TOKEN }}
DINGTALK_WEBHOOK: ${{ secrets.DINGTALK_WEBHOOK }}