Daily LinkedIn Post #9
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: Daily LinkedIn Post | |
| on: | |
| schedule: | |
| # Runs every day at 9:00 AM UTC (adjust timezone as needed) | |
| - cron: '0 9 * * *' | |
| workflow_dispatch: # Allows manual trigger from GitHub | |
| jobs: | |
| post: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: '3.10' | |
| - name: Install dependencies | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install requests python-dateutil groq python-dotenv | |
| - name: Run LinkedIn Post Bot | |
| env: | |
| LINKEDIN_ACCESS_TOKEN: ${{ secrets.LINKEDIN_ACCESS_TOKEN }} | |
| LINKEDIN_USER_URN: ${{ secrets.LINKEDIN_USER_URN }} | |
| GROQ_API_KEY: ${{ secrets.GROQ_API_KEY }} | |
| GITHUB_USERNAME: ${{ secrets.GITHUB_USERNAME }} | |
| run: python bot.py | |
| - name: Upload last generated post | |
| if: always() | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: generated-posts | |
| path: last_generated_post.txt | |
| retention-days: 60 |