mirror of
https://github.com/Brandon-Rozek/website-toots.git
synced 2025-10-09 01:11:12 +00:00
GitHub actions sync mastodon data
This commit is contained in:
parent
1cdac38646
commit
b6e3498aae
2 changed files with 251 additions and 0 deletions
35
.github/workflows/refresh.yml
vendored
Normal file
35
.github/workflows/refresh.yml
vendored
Normal file
|
@ -0,0 +1,35 @@
|
|||
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: |
|
||||
git config usegit pusr.name "GitHub Actions Bot"
|
||||
git config user.email "<>"
|
||||
|
||||
- name: Grab latest toots
|
||||
run: |
|
||||
./.scripts/refreshtoots.py
|
||||
|
||||
- name: Check if there's any changes
|
||||
id: verify_diff
|
||||
run: |
|
||||
git diff --quiet . || echo "changed=true" >> $GITHUB_OUTPUT
|
||||
|
||||
- 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
|
Loading…
Add table
Add a link
Reference in a new issue