Post New Blog to Bluesky #12
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
| name: Post New Blog to Bluesky | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - 'src/content/blog/**' | |
| schedule: | |
| # 8 AM Eastern: 13:00 UTC (EST) / 12:00 UTC (EDT) | |
| # Using 13:00 UTC = 8 AM EST, 9 AM EDT | |
| - cron: '0 13 * * *' | |
| workflow_dispatch: | |
| jobs: | |
| detect: | |
| uses: CodingWithCalvin/.github/.github/workflows/detect-new-blog-post.yml@main | |
| with: | |
| content_path: 'src/content/blog' | |
| post_filename: 'index.md' | |
| site_url: 'https://www.codingwithcalvin.net' | |
| url_prefix: '' | |
| event_name: ${{ github.event_name }} | |
| categories_field: 'categories' | |
| wait-for-deploy: | |
| needs: detect | |
| if: needs.detect.outputs.has_new_post == 'true' && github.event_name == 'push' | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Wait for Cloudflare deployment | |
| run: | | |
| echo "Waiting 5 minutes for Cloudflare to deploy..." | |
| sleep 300 | |
| notify: | |
| needs: [detect, wait-for-deploy] | |
| if: always() && needs.detect.outputs.has_new_post == 'true' && needs.detect.result == 'success' | |
| uses: CodingWithCalvin/.github/.github/workflows/bluesky-post.yml@main | |
| with: | |
| post_text: | | |
| 📝 New Blog Post! | |
| [${{ needs.detect.outputs.post_title }}](${{ needs.detect.outputs.post_url }}) | |
| ${{ needs.detect.outputs.post_hashtags }} | |
| embed_url: ${{ needs.detect.outputs.post_url }} | |
| embed_title: ${{ needs.detect.outputs.post_title }} | |
| embed_description: ${{ needs.detect.outputs.post_description }} | |
| secrets: | |
| BLUESKY_USERNAME: ${{ secrets.BLUESKY_USERNAME }} | |
| BLUESKY_APP_PASSWORD: ${{ secrets.BLUESKY_APP_PASSWORD }} |