Update Scrapbook #953
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 | |
- 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: yarn 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 }} | |
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
run: | | |
node scripts/scrapbook/dl.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 }} | |