Nightly update from google sheet #238
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: Nightly update from google sheet | |
# TODO: run nightly | |
on: | |
workflow_dispatch: | |
push: | |
branches: | |
- master | |
schedule: | |
# run every night at 2:42 am PST | |
- cron: '42 10 * * *' | |
jobs: | |
main: | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
- uses: actions/setup-python@v4 | |
with: | |
python-version: '3.10' | |
- run: | | |
# activate virtual environment | |
python -m venv venv | |
. venv/bin/activate | |
python -m pip install -r requirements.txt | |
python3 site-generator/generate.py | |
python3 site-generator/kevbot.xyz.py | |
- uses: stefanzweifel/git-auto-commit-action@v4 | |
with: | |
commit_message: Update site | |
commit_options: '--no-verify' | |
commit_user_name: GitHub Actions | |
commit_user_email: github-actions[bot]@users.noreply.github.com | |
commit_author: GitHub Actions <github-actions[bot]@users.noreply.github.com> | |
file_pattern: index.html site-generator/generated/* | |
- uses: gacts/purge-jsdelivr-cache@v1 | |
if: steps.auto-commit-action.outputs.changes_detected == 'true' | |
with: | |
url: | | |
https://cdn.jsdelivr.net/gh/kleutzinger/kleutzinger.github.io/site-generator/generated/projects.json | |
https://cdn.jsdelivr.net/gh/kleutzinger/kleutzinger.github.io/site-generator/kevbadge.js |