-
Notifications
You must be signed in to change notification settings - Fork 0
78 lines (64 loc) · 2.02 KB
/
scheduler.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
68
69
70
71
72
73
74
75
76
77
78
name: Scheduler
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches: [main]
jobs:
generate-sponsors:
runs-on: ubuntu-latest
name: Generate sponsors
steps:
- uses: actions/checkout@v4
- name: Setup Node
uses: ./.github/actions/setup-node
- name: Setup CJK fonts
uses: ./.github/actions/setup-fonts
- name: Update sponsors
run: pnpm run build
env:
SPONSORKIT_AFDIAN_USER_ID: ${{ secrets.SPONSORKIT_AFDIAN_USER_ID }}
SPONSORKIT_AFDIAN_TOKEN: ${{ secrets.SPONSORKIT_AFDIAN_TOKEN }}
SPONSORKIT_AFDIAN_EXECHANGERATE: 1
SPONSORKIT_AFDIAN_WEB_AUTH_TOKEN: ${{ secrets.SPONSORKIT_AFDIAN_WEB_AUTH_TOKEN }}
SPONSORKIT_MOONCELL_PATH: './assets/data.csv'
- name: Upload generated files
uses: actions/upload-artifact@v3
with:
name: generated
path: |
${{ github.workspace }}/sponsors.*
update-sponsors:
runs-on: ubuntu-latest
name: Update sponsors
needs: generate-sponsors
steps:
- uses: actions/checkout@v4
- name: Setup OSS
uses: ./.github/actions/setup-oss
with:
ossutil-config: ${{ secrets.OSSUTIL_CONFIG }}
- name: Checkout to assets branch
uses: actions/checkout@v4
with:
ref: assets
- name: Download results
uses: actions/download-artifact@v3
with:
name: generated
path: ${{ github.workspace }}
- name: Push generated files
run: |
git config user.name github-actions[bot]
git config user.email github-actions[bot]@users.noreply.github.com
git add sponsors.*
git diff-index --quiet HEAD || git commit -m "chore: update sponsors.svg"
git push
- name: Upload to OSS
run: |
shopt -s extglob
for file in ${{ github.workspace }}/!(*/); do
ossutil64 cp -f $file ${{ secrets.OSS_REMOTE_PATH }}
done
shell: bash