Create Mastodon posts for each new note #322
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: Create Mastodon posts for each new note | |
on: | |
workflow_run: | |
workflows: [Deploy Hugo site to Pages] | |
types: | |
- completed | |
workflow_dispatch: | |
jobs: | |
JSONFeed2Mastodon: | |
runs-on: ubuntu-latest | |
steps: | |
# Checkout the repository to restore previous cache | |
- name: Checkout | |
uses: actions/checkout@v3 | |
# Look for new toots to create from items in the JSON feed | |
- name: Feed to Mastodon | |
uses: nhoizey/github-action-feed-to-mastodon@v2 | |
with: | |
feedUrl: "https://notes.brunopedro.com/index.json" | |
mastodonInstance: "https://follow.brunopedro.com" | |
mastodonToken: ${{ secrets.MASTODON_TOKEN }} | |
globalDelayToots: 1 | |
# Make sure files are up to date if other commits have been pushed in the mean time | |
- name: Pull any changes from Git | |
run: git pull | |
# Push changes in the cache files to the repository | |
# See https://github.com/stefanzweifel/git-auto-commit-action#readme | |
- name: Commit and push | |
uses: stefanzweifel/git-auto-commit-action@v4 |