Backup New Music Friday #168
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: Backup New Music Friday | |
on: | |
schedule: | |
- cron: '00 8 * * 5' | |
workflow_dispatch: | |
jobs: | |
New-Music-Friday-Backup: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout Code | |
uses: actions/[email protected] | |
- name: 🐍 Setup Python Environment | |
uses: actions/[email protected] | |
with: | |
python-version: 3.12.0 | |
- name: 💻 Install Requirements | |
run: pip install -r requirements.txt | |
- name: 💾 Backup Playlist | |
run: python nmf.py | |
env: | |
CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | |
NEW_MUSIC_FRIDAY_ID: ${{ secrets.NEW_MUSIC_FRIDAY_ID }} | |
USER_ID: ${{ secrets.USER_ID }} | |
- name: 📝 Commit updated JSON | |
run: | | |
git config --local user.email "[email protected]" | |
git config --local user.name "GitHub Action" | |
git add json/${{ env.jsn }} | |
git commit -m "${{ env.jsn }} automatic update" -a | |
- name: Push updated JSON | |
uses: ad-m/github-push-action@master | |
with: | |
github_token: ${{ secrets.GITHUB_TOKEN }} | |
# run-if-failed: | |
# runs-on: ubuntu-latest | |
# needs: [execute-cron] | |
# if: always() && (needs.execute-cron.result == 'failure') | |
# steps: | |
# - name: Sleep Action | |
# uses: juliangruber/[email protected] | |
# with: | |
# time: 10m | |
# - name: Checkout Code | |
# uses: actions/[email protected] | |
# - name: 🐍 Setup Python Environment | |
# uses: actions/[email protected] | |
# with: | |
# python-version: 3.12.0 | |
# - name: 💻 Install Requirements | |
# run: pip install -r requirements.txt | |
# - name: 💾 Backup Playlist | |
# run: python nmf.py | |
# env: | |
# CLIENT_ID: ${{ secrets.CLIENT_ID }} | |
# CLIENT_SECRET: ${{ secrets.CLIENT_SECRET }} | |
# REFRESH_TOKEN: ${{ secrets.REFRESH_TOKEN }} | |
# NEW_MUSIC_FRIDAY_ID: ${{ secrets.NEW_MUSIC_FRIDAY_ID }} | |
# USER_ID: ${{ secrets.USER_ID }} | |
# - name: 📝 Commit updated JSON | |
# run: | | |
# git config --local user.email "[email protected]" | |
# git config --local user.name "GitHub Action" | |
# git add json/${{ env.jsn }} | |
# git commit -m "${{ env.jsn }} automatic update" -a | |
# - name: Push updated JSON | |
# uses: ad-m/github-push-action@master | |
# with: | |
# github_token: ${{ secrets.GITHUB_TOKEN }} | |
# - name: Tweet NMF | |
# id: tweet | |
# uses: snow-actions/[email protected] | |
# env: | |
# CONSUMER_API_KEY: ${{ secrets.TWITTER_CONSUMER_API_KEY }} | |
# CONSUMER_API_SECRET_KEY: ${{ secrets.TWITTER_CONSUMER_API_SECRET_KEY }} | |
# ACCESS_TOKEN: ${{ secrets.TWITTER_ACCESS_TOKEN }} | |
# ACCESS_TOKEN_SECRET: ${{ secrets.TWITTER_ACCESS_TOKEN_SECRET }} | |
# with: | |
# status: | | |
# La #playlist New Music Friday Italia della settimana è ora disponibile! Inquadra il codice con l'applicazione #Spotify per ascoltarla :-) | #NewMusicFridayItalia #NewMusicFriday | |
# media_paths: | | |
# nmf_cover.png | |
# nmf_spoticode.png |