Skip to content

Daily Run

Daily Run #1002

Workflow file for this run

name: Daily Run
on:
schedule:
- cron: "0 9 * * *"
push:
branches: [main]
pull_request:
branches: [main]
jobs:
RunScripts:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Cache pip dependencies
uses: actions/cache@v3
with:
path: ~/.cache/pip
key: ${{ runner.os }}-pip-${{ hashFiles('**/requirements.txt') }}
restore-keys: |
${{ runner.os }}-pip-
- name: Set up Python 3.x
uses: actions/setup-python@v4
with:
python-version: "3.x"
- name: Display Python version
run: |
python -c "import sys; print(sys.version)"
- name: Write config.py
run: |
if [ -f config.py ]; then rm -f "config.py"; fi
echo "${{ secrets.config }}" >>config.py
echo Wrote config
# - name: Sync Time
# run: |
# sudo apt-get install ntpdate
# NEEDS_SYNC=1
# while [ "$NEEDS_SYNC" -ne "0" ]; do
# sudo ntpdate -t 4 0.ca.pool.ntp.org
# NEEDS_SYNC=$? # If this variable is set ot 0, time sync worked
# sleep 2
# done
# date +%H:%M:%S
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install flake8 pytest
if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
- name: Run Lofi
run: |
python LoFi.py
if: always()
- name: Run Dubstep
run: |
python Dubstep.py
if: always()
# - name: Run Daily Song
# run: |
# python DailySong.py
# if: always()
- name: Run Backup
run: |
python Backup.py
if: always()
- name: Cleanup
run: if [ -f config.py ]; then rm -f "config.py"; fi
if: always()
# - name: Archive Logs
# uses: actions/upload-artifact@v2
# with:
# name: DailyPy_Logs
# path: |
# logs
# !dist/**/*.md