Skip to content

Scheduler

Scheduler #16

Workflow file for this run

name: Scheduler
on:
workflow_dispatch:
schedule:
- cron: "0 0 * * *"
push:
branches: [master]
jobs:
generate-sponsors:
runs-on: ubuntu-latest
name: Generate sponsors
environment: sponsor
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_TOKEN: ${{ secrets.AFDIAN_TOKEN }}
SPONSORKIT_AFDIAN_USER_ID: ${{ secrets.AFDIAN_USER_ID }}
SPONSORKIT_AFDIAN_EXECHANGERATE: 7
SPONSORKIT_OPENCOLLECTIVE_KEY: ${{ secrets.OPENCOLLECTIVE_KEY }}
SPONSORKIT_OPENCOLLECTIVE_SLUG: ${{ secrets.OPENCOLLECTIVE_SLUG }}
SPONSORKIT_OPENCOLLECTIVE_TYPE: person
- 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:
- name: Checkout
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 ":money_with_wings: update sponsors.svg"
git push