Deploy README.md #3201
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: Deploy README.md | |
on: | |
workflow_dispatch: # Allow manual triggering | |
schedule: | |
- cron: '0 * * * *' # Do this hourly because that's fun | |
permissions: | |
contents: write | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
environment: deployment | |
strategy: | |
fail-fast: true | |
steps: | |
- uses: actions/checkout@v4 | |
- uses: actions/setup-python@v5 | |
with: | |
python-version: "3.12" | |
- uses: abatilo/actions-poetry@v3 | |
with: | |
poetry-version: "1.8.5" | |
- run: poetry install | |
- run: poetry run python scripts/generate_readme.py | |
env: | |
SPOTIPY_CLIENT_ID: ${{ secrets.SPOTIPY_CLIENT_ID }} | |
SPOTIPY_CLIENT_SECRET: ${{ secrets.SPOTIPY_CLIENT_SECRET }} | |
SPOTIPY_REDIRECT_URI: ${{ secrets.SPOTIPY_REDIRECT_URI }} | |
SPOTIPY_REFRESH_TOKEN: ${{ secrets.SPOTIPY_REFRESH_TOKEN }} | |
HARDCOVER_AUTHORIZATION: ${{ secrets.HARDCOVER_AUTHORIZATION }} | |
- name: Deploy README.md | |
run: | | |
git config --global user.name 'Tsung-Ju Lii' | |
git config --global user.email 'usefulalgorithm@users.noreply.github.com' | |
git add README.md | |
if git diff-index --quiet HEAD; then | |
echo "No changes to commit." | |
exit 0 | |
fi | |
git commit -m "Update README: `date +'%Y-%m-%dT%H:%M:%S%z'`" | |
git push | |