Check for scheduled posts to publish #2344
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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" | |