Skip to content

sync ⚙️

sync ⚙️ #2249

Workflow file for this run

name: build
on:
push:
branches:
- main
schedule:
- cron: "0 4 * * *"
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
token: ${{ secrets.GH_PAT }}
- name: Install Poetry
run: pipx install poetry
- name: Setup Python
uses: actions/setup-python@v5
with:
python-version: "3.10"
cache: "poetry"
- name: Install Python dependencies
run: poetry install
- name: Test
run: poetry run blog test
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: "latest"
cache: "npm"
cache-dependency-path: "./theme/package-lock.json"
- name: Install JS dependencies for the theme
run: npm install --prefix=./theme
- name: Synchronize toots
env:
MASTODON_CLIENT_ID: ${{ secrets.MASTODON_CLIENT_ID }}
MASTODON_CLIENT_SECRET: ${{ secrets.MASTODON_CLIENT_SECRET }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
run: poetry run blog toots
- name: Pelican Build
run: poetry run blog build
- name: "Extra: Kočárkino"
run: poetry run blog kocarkino > ./public/kocarkino.ics
- name: "Extra: Pediatr"
run: poetry run blog pediatr > ./public/pediatr.xml
- name: "Extra: Notion Feeds"
env:
NOTION_TOKEN: ${{ secrets.NOTION_TOKEN }}
run: |
poetry run blog notion reading > ./public/reading.xml
poetry run blog notion watching > ./public/watching.xml
- name: Deploy to GitHub Pages
uses: peaceiris/actions-gh-pages@v4
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public
cname: honzajavorek.cz
- name: Wait for deployment
run: poetry run blog wait
- name: Send to Telegram
env:
TELEGRAM_BOT_TOKEN: ${{ secrets.TELEGRAM_BOT_TOKEN }}
run: poetry run blog telegram
- name: Send to Mastodon
env:
MASTODON_CLIENT_ID: ${{ secrets.MASTODON_CLIENT_ID }}
MASTODON_CLIENT_SECRET: ${{ secrets.MASTODON_CLIENT_SECRET }}
MASTODON_ACCESS_TOKEN: ${{ secrets.MASTODON_ACCESS_TOKEN }}
run: poetry run blog mastodon
- name: Save to Git
uses: EndBug/add-and-commit@v9
with:
pull: --rebase --autostash
add: ./content
message: "sync ⚙️"