Update copy of microblog #18
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 copy of microblog | |
on: | |
workflow_dispatch: {} | |
schedule: | |
- cron: "0 * * * *" # Hourly | |
permissions: | |
contents: write | |
jobs: | |
update_and_render: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: '3.10' | |
- name: Update DB and render | |
run: python3 mastodon.py --update --download-media | |
- name: Commit and push | |
run: | | |
if ! ( git update-index --refresh && git diff-index --quiet HEAD -- ); then | |
# Only try to commit & push if there are changes | |
git config --global user.name 'Max Bernstein' | |
git config --global user.email '[email protected]' | |
git add mastodon.json microblog.html assets/mastodon | |
git commit -m "Update Mastodon microblog" | |
git push | |
fi |