Skip to content

Check for scheduled posts to publish #2350

Check for scheduled posts to publish

Check for scheduled posts to publish #2350

name: Check for scheduled posts to publish
on:
schedule:
- cron: '0 4,16 * * *'
jobs:
check-n-publish:
name: Check for scheduled posts and publish if any found
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
- name: Install dependencies
run: npm ci
- name: Check for scheduled posts
run: echo "should_publish=$(${{ github.workspace }}/scripts/scheduled-publishing.js)" >> $GITHUB_OUTPUT
id: should_publish_step
- name: Trigger Fleek Build
if: ${{ steps.should_publish_step.outputs.should_publish == 'true' }}
run: curl -H "Authorization:${{ secrets.FLEEK_API_KEY }}" -H "Content-Type:application/json" -d '{"query":"mutation { triggerDeploy(siteId:\"${{ secrets.FLEEK_SITE_ID }}\") { status } }"}' https://api.fleek.co/graphql
- name: Scheduled posts published
if: ${{ steps.should_publish_step.outputs.should_publish == 'true' }}
run: echo "Check https://blog.ipfs.tech"