Generate New Article #168
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: Generate New Article | |
| on: | |
| workflow_dispatch: | |
| schedule: | |
| - cron: "0 20 * * *" | |
| jobs: | |
| write_article: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout Repository | |
| uses: actions/checkout@v4 | |
| - name: Install Python Dependencies | |
| run: pip install openai bs4 requests pyyaml xai_sdk | |
| - name: Compose New Article | |
| env: | |
| DS_APIKEY: ${{ secrets.DS_APIKEY }} | |
| XAI_API_KEY: ${{ secrets.XAI_API_KEY }} | |
| run: python3 scripts/writer.py | |
| - name: Commit and Push Changes | |
| env: | |
| GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} | |
| run: | | |
| git config user.name "github-actions[bot]" | |
| git config user.email "github-actions[bot]@users.noreply.github.com" | |
| git add . | |
| git commit -m "chore: new article written" || echo "no changes to commit" | |
| git push origin HEAD:main | |
| compile: | |
| needs: write_article | |
| uses: ./.github/workflows/auto-publisher.yml |