Generate New Article #7
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 libraries | |
| run: | | |
| pip install openai bs4 requests pyyaml | |
| - name: Article creation script | |
| env: | |
| DS_APIKEY: ${{ secrets.DS_APIKEY }} | |
| run: | | |
| python3 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 "feat(auto): created new article" || echo "no changes to commit" | |
| git push origin HEAD:main | |
| compile: | |
| needs: write_article | |
| uses: ./.github/workflows/publ.yml |