-
Notifications
You must be signed in to change notification settings - Fork 0
46 lines (38 loc) · 1.2 KB
/
run.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
name: Fetch GitHub Trending
on:
push:
branches:
- main
schedule:
- cron: '0 1 * * *' # UTC 凌晨 1 点
- cron: '0 7 * * *' # UTC 早 7 点
- cron: '0 13 * * *' # UTC 中午 1 点
- cron: '0 19 * * *' # UTC 下午 7 点
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: '20'
- name: Install pnpm
run: npm install -g pnpm
- name: Install dependencies
run: pnpm install
# - name: Build the languages
# run: pnpm gen:lang
- name: Build the trending
run: pnpm build
- name: Commit and Push changes
if: github.event_name == 'schedule' || (github.event_name == 'push' && github.ref == 'refs/heads/main')
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add .
COMMIT_TIME=$(date -u +"%Y-%m-%dT%H:%M:%SZ")
git commit -m "publish🚀: Fetch GitHub Trending at $COMMIT_TIME"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}