Skip to content

DailyUpdate

DailyUpdate #1723

Workflow file for this run

# This is a basic workflow to help you get started with Actions
name: DailyUpdate
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
schedule:
- cron: "0 0 * * *"
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: ubuntu-latest
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
- uses: actions/checkout@v2
- name: Set up Python 3.7
uses: actions/setup-python@v1
with:
python-version: 3.7
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install -r requirements.txt
- name: Generate new index.html
run: |
cd $GITHUB_WORKSPACE
python spotigen.py ${{ secrets.CLIENT_ID }} ${{ secrets.CLIENT_SECRET }} ${{ secrets.REFRESH_TOKEN }}
- name: Commit new index.html
run: |
git config --global user.email "[email protected]"
git config --global user.name "Tony Yang"
git add index.html
git diff --quiet && git diff --staged --quiet || git commit -m "Update index.html" && git push --set-upstream origin master
- name: Cache pip
uses: actions/cache@v1
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-