Skip to content

Update Scrapbook

Update Scrapbook #50

name: Update Scrapbook
on:
push:
branches:
- main
- master
schedule:
# - cron: '0 0 * * *' # Runs every day at midnight
# - cron: '0 */2 * * *' # Runs every 2 hours
- cron: '0 */8 * * *' # Runs every 8 hours
jobs:
update-scrapbook:
runs-on: ubuntu-latest
steps:
- name: Checkout Repository
uses: actions/checkout@v2
- name: Setup Node.js
uses: actions/setup-node@v2
with:
node-version: 18
- name: Install Dependencies
run: npm install
- name: Run Scripts
env:
CLOUDINARY_CLOUD_NAME: ${{ secrets.CLOUDINARY_CLOUD_NAME }}
CLOUDINARY_API_KEY: ${{ secrets.CLOUDINARY_API_KEY }}
CLOUDINARY_API_SECRET: ${{ secrets.CLOUDINARY_API_SECRET }}
PINBOARD_TOKEN: ${{ secrets.PINBOARD_TOKEN }}
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
ARENA_ACCESS_TOKEN: ${{ secrets.ARENA_ACCESS_TOKEN }}
run: |
node scripts/scrapbook/dl_arena.mjs
node scripts/scrapbook/dl_mastodon.mjs
node scripts/scrapbook/dl_pinboard.mjs
- name: Commit and Push Changes
run: |
git config --local user.email "[email protected]"
git config --local user.name "GitHub Action"
git add -A
git commit -m "chore(scrapbook): update scrapbook items $(date +%Y-%m-%d-%H)" || exit 0 # exit gracefully if no changes
git push
env:
PINBOARD_TOKEN: ${{ secrets.PINBOARD_TOKEN }}
MASTODON_TOKEN: ${{ secrets.MASTODON_TOKEN }}
ARENA_ACCESS_TOKEN: ${{ secrets.ARENA_ACCESS_TOKEN }}