Fetch and Save Trending #5
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: Fetch and Save Trending | |
on: | |
schedule: | |
- cron: '0 12 * * *' | |
workflow_dispatch: | |
permissions: | |
contents: write | |
jobs: | |
build: | |
name: Fetech and Save Trending | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-node@v4 | |
with: | |
node-version: '20' | |
- name: Install pnpm | |
run: npm i pnpm -g | |
- name: Install Dependencies | |
run: pnpm install | |
- name: Run Scripts | |
run: pnpm start | |
env: | |
MASTODON_ENABLED: ${{ vars.MASTODON_ENABLED }} | |
MASTODON_URL: ${{ vars.MASTODON_URL }} | |
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }} | |
- name: Publish | |
run: | | |
git config --global user.name "github-actions[bot]" | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git add data | |
git commit -m "Fetch latest trending" | |
git push |