Generate Weekly Listened to Blog Post #124
This file contains 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 Weekly Listened to Blog Post | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: "00 02 * * 1" | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
steps: | |
- name: "👨💻 Check out code" | |
uses: actions/checkout@v4 | |
- name: "🐍 Set up Python" | |
uses: actions/setup-python@v5 | |
with: | |
python-version: 3.12 | |
cache: "pip" | |
cache-dependency-path: "generate_blog_post.txt" | |
- name: "🦾 Install dependencies" | |
run: pip install -r generate_blog_post.txt | |
- name: "🏃♂️ Run the python script to generate blog post" | |
env: | |
LASTFM_USER: "${{ secrets.LASTFM_USER }}" | |
LASTFM_API_KEY: "${{ secrets.LASTFM_API_KEY }}" | |
COLLECTION_URL: "${{ secrets.COLLECTION_URL }}" | |
OPENAI_API_KEY: "${{ secrets.OPENAI_API_KEY }}" | |
OPENAI_MODEL_NAME: "${{ secrets.OPENAI_MODEL_NAME }}" | |
run: python generate_blog_post.py | |
- name: "🚨 Create Pull Request" | |
uses: peter-evans/create-pull-request@v5 | |
with: | |
token: "${{ secrets.GITHUB_TOKEN }}" | |
commit-message: "🤖 Add weekly listened to blog posts" | |
title: "🤖 Add weekly listened to blog posts" | |
body: "This week, I have mostly been listening to..." | |
branch: "weekly-listened-to-blog-post" | |
branch-suffix: timestamp |