Skip to content

Scheduler

Scheduler #537

Workflow file for this run

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@v4
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: Download results
uses: actions/download-artifact@v4
with:
name: generated
path: ${{ github.workspace }}/generated
- name: Upload to OSS
run: |
shopt -s extglob
for file in ${{ github.workspace }}/generated/!(*/); do
ossutil64 cp -f $file ${{ secrets.OSS_REMOTE_PATH }}
done
shell: bash