feat: SEO title automation + CI check for title lengths #38
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: Auto-Tweet New Blog Post | |
| on: | |
| push: | |
| branches: | |
| - master | |
| paths: | |
| - '_posts/**' | |
| jobs: | |
| tweet: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| with: | |
| fetch-depth: 2 # Fetch last 2 commits to detect new files | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: '3.x' | |
| - name: Install dependencies | |
| run: | | |
| pip install tweepy pyyaml | |
| - name: Wait for GitHub Pages to deploy | |
| run: | | |
| echo "Waiting 180 seconds for GitHub Pages to deploy..." | |
| sleep 180 | |
| - name: Detect new blog post and tweet | |
| env: | |
| TWITTER_API_KEY: ${{ secrets.TWITTER_API_KEY }} | |
| TWITTER_API_SECRET: ${{ secrets.TWITTER_API_SECRET }} | |
| TWITTER_ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
| TWITTER_ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
| run: | | |
| python .github/scripts/tweet-new-post.py || { | |
| echo "" | |
| echo "⚠️ Tweet failed - likely Cloudflare blocking GitHub Actions IPs" | |
| echo "👉 Use local script instead: python3 scripts/tweet-local.py" | |
| echo "" | |
| echo "This is a known issue as of Jan 2026." | |
| echo "The blog post was still published successfully!" | |
| exit 0 # Don't fail the workflow - blog is deployed | |
| } |