GoodMorning #1150
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
name: GoodMorning | |
on: | |
workflow_dispatch: | |
branches: | |
- master | |
schedule: | |
- cron: '50 23 * * *' # 每天 23:50 UTC,即北京时间 07:50 | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
# 1. Checkout 仓库 | |
- uses: actions/checkout@v3 | |
# 2. 设置 pnpm 包管理器 | |
- name: Install pnpm | |
uses: pnpm/action-setup@v2 | |
with: | |
version: 7 | |
# 3. 设置 Node 版本 | |
- name: Set node version to 16 | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '16.x' | |
# 4. 缓存 pnpm store | |
- name: Cache pnpm store | |
uses: actions/cache@v3 | |
with: | |
path: ~/.pnpm-store | |
key: ${{ runner.os }}-pnpm-${{ hashFiles('**/pnpm-lock.yaml') }} | |
restore-keys: | | |
${{ runner.os }}-pnpm- | |
# 5. 安装依赖 | |
- name: Install dependencies | |
run: pnpm install | |
# 6. 运行脚本 | |
- name: Run script | |
run: pnpm start | |
env: | |
WX_COMPANY_ID: ${{ secrets.WX_COMPANY_ID }} | |
WX_APP_ID: ${{ secrets.WX_APP_ID }} | |
WX_APP_SECRET: ${{ secrets.WX_APP_SECRET }} | |
TIAN_API_KEY: ${{ secrets.TIAN_API_KEY }} | |
MESSAGE_TYPE: goodMorning |