website-toots/.github/workflows/refresh.yml

36 lines
827 B
YAML
Raw Normal View History

2022-12-01 00:28:10 -05:00
name: Sync Toots from Mastodon
on:
workflow_dispatch:
schedule:
- cron: "12 23 * * *"
jobs:
build_and_publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Setup git config
run: |
2022-12-01 00:29:34 -05:00
git config user.name "GitHub Actions Bot"
2022-12-01 00:28:10 -05:00
git config user.email "<>"
- name: Grab latest toots
run: |
./.scripts/refreshtoots.py
- name: Check if there's any changes
id: verify_diff
run: |
if [ -n "$(git status --porcelain)" ]; then echo "changed=true" || tee -a $GITHUB_OUTPUT; fi
2022-12-01 00:28:10 -05:00
- name: Commit and push
if: steps.verify_diff.outputs.changed == 'true'
run: |
git add *.md
git commit -m "New/Modified Toots"
git push origin main