mirror of
https://github.com/Brandon-Rozek/website-toots.git
synced 2024-11-09 10:40:35 -05:00
50 lines
1.1 KiB
YAML
50 lines
1.1 KiB
YAML
name: Sync Toots from Mastodon
|
|
|
|
on:
|
|
workflow_dispatch:
|
|
schedule:
|
|
- cron: "12 23 * * *"
|
|
|
|
defaults:
|
|
run:
|
|
shell: bash
|
|
|
|
jobs:
|
|
build_and_sync:
|
|
runs-on: ubuntu-latest
|
|
|
|
steps:
|
|
- name: Checkout
|
|
uses: actions/checkout@v3
|
|
|
|
- name: Setup git config
|
|
run: |
|
|
git config user.name "GitHub Actions Bot"
|
|
git config user.email "<>"
|
|
|
|
- name: Install Rust
|
|
run: |
|
|
sudo apt update
|
|
sudo apt install -y rustc cargo
|
|
|
|
- name: Build
|
|
run: |
|
|
cd .scripts
|
|
cargo build --release
|
|
|
|
- name: Retrieve toots
|
|
run: |
|
|
cd .scripts
|
|
./target/release/retrieve_toots
|
|
|
|
- name: Check if there's any changes
|
|
id: verify_diff
|
|
run: |
|
|
if [ -n "$(git status --porcelain)" ]; then echo ::set-output name=changed::true; fi
|
|
|
|
- name: Commit and push
|
|
if: steps.verify_diff.outputs.changed == 'true'
|
|
run: |
|
|
git add .data
|
|
git commit -m "New/Modified Toots"
|
|
git push origin main
|