Daily Post #1061
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 Post | |
| on: | |
| schedule: | |
| - cron: "00 01 * * *" # Runs at 01:00 UTC daily | |
| - cron: "00 15 * * *" # Runs at 15:00 UTC daily | |
| - cron: "00 21 * * *" # Runs at 21:00 UTC daily | |
| workflow_dispatch: | |
| jobs: | |
| run-bot: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v4 | |
| with: | |
| python-version: "3.12" | |
| - name: Install dependencies | |
| run: pip install -r requirements.txt | |
| - name: Run script | |
| env: | |
| X_API_KEY: ${{ secrets.X_API_KEY }} | |
| X_API_KEY_SECRET: ${{ secrets.X_API_KEY_SECRET }} | |
| X_BEARER_TOKEN: ${{ secrets.X_BEARER_TOKEN }} | |
| X_ACCESS_TOKEN: ${{ secrets.X_ACCESS_TOKEN }} | |
| X_ACCESS_TOKEN_SECRET: ${{ secrets.X_ACCESS_TOKEN_SECRET }} | |
| MONGO_USER: ${{ secrets.MONGO_USER }} | |
| MONGO_PASSWORD: ${{ secrets.MONGO_PASSWORD }} | |
| MONGO_CLUSTER: ${{ secrets.MONGO_CLUSTER }} | |
| run: python post_tuits.py | |
| - name: Commit and push changes | |
| if: success() | |
| run: | | |
| git config --local user.name "github-actions[bot]" | |
| git config --local user.email "github-actions[bot]@users.noreply.github.com" | |
| git add chuchu_bot.log | |
| git commit -m "Daily update" | |
| git push | |
| env: | |
| GH_TOKEN: ${{ secrets.GITHUB_TOKEN }} |