Update Ghost Blog Data #41
This file contains hidden or 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
| # NOTE: THIS GITHUB ACTION WILL ONLY RUN ON MAIN BRANCH. | |
| # N8N IS BEING USING AS AN ALTERNATIVE UNTIL THEN. | |
| # N8N workflow is in /snippets/automations/n8n-workflows/ghost-to-mintlify.json | |
| name: Update Ghost Blog Data | |
| on: | |
| schedule: | |
| - cron: "0 0 * * *" | |
| workflow_dispatch: | |
| jobs: | |
| update-ghost-data: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout docs repository | |
| uses: actions/checkout@v4 | |
| with: | |
| token: ${{ secrets.DOCS_V2 }} | |
| - name: Setup Node.js | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: "18" | |
| - name: Fetch and process Ghost blog data | |
| env: | |
| GHOST_CONTENT_API_KEY: ${{ secrets.GHOST_CONTENT_API_KEY }} | |
| run: | | |
| node .github/scripts/fetch-ghost-blog-data.js | |
| - name: Commit and push if changed | |
| run: | | |
| git config user.name "GitHub Action" | |
| git config user.email "action@github.com" | |
| git add snippets/automations/blog/ghostBlogData.jsx | |
| git diff --quiet && git diff --staged --quiet || (git commit -m "Update Ghost blog data - $(date -u +"%Y-%m-%dT%H:%M:%SZ")" && git push) |