Update Scrapbook #34
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: Update Scrapbook | |
on: | |
push: | |
branches: | |
- main | |
- master | |
schedule: | |
# - cron: '0 0 * * *' # Runs every day at midnight | |
- cron: '0 */2 * * *' # Runs every 2 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 }} | |