Skip to content

Commit 8e9ec9a

Browse files
authored
Create main.yml
1 parent db44f6e commit 8e9ec9a

1 file changed

Lines changed: 51 additions & 0 deletions

File tree

.github/workflows/main.yml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
# This workflow will do a clean install of node dependencies, build the source code and run tests across different versions of node
2+
# For more information see: https://help.github.com/actions/language-and-framework-guides/using-nodejs-with-github-actions
3+
4+
name: 企鹅阅读
5+
6+
on:
7+
workflow_dispatch:
8+
schedule:
9+
- cron: '*/11 * * * *'
10+
watch:
11+
types: [started]
12+
13+
jobs:
14+
build:
15+
runs-on: ubuntu-latest
16+
if: github.event.repository.owner.id == github.event.sender.id
17+
env:
18+
QQREAD_HEADER: ${{ secrets.QQREAD_HEADER }}
19+
QQREAD_TIMEHEADER: ${{ secrets.QQREAD_TIMEHEADER }}
20+
QQREAD_TIMEURL: ${{ secrets.QQREAD_TIMEURL }}
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v2
24+
with:
25+
repository: lxmd01/youth
26+
- name: Use Node.js ${{ matrix.node-version }}
27+
uses: actions/setup-node@v1
28+
with:
29+
node-version: ${{ matrix.node-version }}
30+
- name: Cache node_modules
31+
uses: actions/cache@v2 # 使用 GitHub 官方的缓存 Action。
32+
env:
33+
cache-name: cache-node-modules
34+
with:
35+
path: node_modules
36+
key: ${{ runner.os }}-${{ env.cache-name }}-${{ hashFiles('package-lock.json') }} # 使用 package-lock.json 的 Hash 作为缓存的 key。也可以使用 package.json 代替
37+
- name: npm install
38+
if: env.QQREAD_HEADER
39+
run: |
40+
npm install
41+
- name: ' 运行 【企鹅阅读】'
42+
run: |
43+
node qqread.js
44+
env:
45+
PUSH_KEY: ${{ secrets.PUSH_KEY }}
46+
BARK_PUSH: ${{ secrets.BARK_PUSH }}
47+
BARK_SOUND: ${{ secrets.BARK_SOUND }}
48+
TG_BOT_TOKEN: ${{ secrets.TG_BOT_TOKEN }}
49+
TG_USER_ID: ${{ secrets.TG_USER_ID }}
50+
DD_BOT_TOKEN: ${{ secrets.DD_BOT_TOKEN }}
51+
DD_BOT_SECRET: ${{ secrets.DD_BOT_SECRET }}

0 commit comments

Comments
 (0)