Skip to content

Publish scheduled posts #8

Publish scheduled posts

Publish scheduled posts #8

Workflow file for this run

name: Publish scheduled posts
on:
# Runs every Monday.
# GitHub Actions cron is always UTC.
#
# Europe/London (GMT) in winter: 09:30 UTC = 09:30 London
# Europe/London (BST) in summer: 09:30 UTC = 10:30 London (1 hour late)
#
# To hit the same London time all year you would need two schedules,
# or accept the summer offset. See docs/deployment.md for details.
schedule:
- cron: '30 9 * * 1'
# Allows you to trigger the workflow manually from the Actions tab.
# Useful for testing or catching up on a missed run.
workflow_dispatch:
jobs:
publish:
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '20'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Restore LinkedIn credentials
# Writes the credentials JSON to the path InPost expects.
# See docs/deployment.md for how to obtain and refresh this secret.
run: |
mkdir -p ~/.inpost
echo '${{ secrets.LINKEDIN_CREDENTIALS }}' > ~/.inpost/credentials.json
chmod 600 ~/.inpost/credentials.json
- name: Run pipeline
run: node dist/src/index.js schedule --once
env:
NOTION_API_TOKEN: ${{ secrets.NOTION_API_TOKEN }}
NOTION_DATABASE_ID: ${{ secrets.NOTION_DATABASE_ID }}
ANTHROPIC_API_KEY: ${{ secrets.ANTHROPIC_API_KEY }}
GEMINI_API_KEY: ${{ secrets.GEMINI_API_KEY }}
GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }}
DEFAULT_TONE: ${{ secrets.DEFAULT_TONE }}
LOG_LEVEL: ${{ secrets.LOG_LEVEL }}