Update CIS52 Schedule #29
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: Update CIS52 Schedule | |
on: | |
schedule: | |
# Runs at 01:00 UTC every day | |
- cron: '0 1 * * *' | |
workflow_dispatch: # Allows manual triggering | |
jobs: | |
update-popular-posts: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Set up Python 3.9 | |
uses: actions/setup-python@v4 | |
with: | |
python-version: '3.9' | |
- name: Install Poetry | |
run: | | |
curl -sSL https://install.python-poetry.org | python3 - | |
echo "$HOME/.local/bin" >> $GITHUB_PATH | |
- name: Install dependencies | |
run: | | |
cd data-runners/yaml-datagen | |
poetry install | |
- name: Run update script | |
env: | |
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GOOGLE_APPLICATION_CREDENTIALS }} | |
run: | | |
cd data-runners/yaml-datagen | |
echo "$GOOGLE_APPLICATION_CREDENTIALS" > google_credentials.json | |
poetry run python yaml_datagen.py --credentialspath 'google_credentials.json' --gsheet --input '1FSi3twUBvCw3qgODtFXqhizeNbOKuVPiMD3fM-AXP2Y' --output '../../_data/merritt-cis52-schedule.yml' | |
- name: Commit and push if changed | |
run: | | |
git config --global user.email "github-actions[bot]@users.noreply.github.com" | |
git config --global user.name "github-actions[bot]" | |
git add _data/merritt-cis52-schedule.yml | |
git diff --quiet && git diff --staged --quiet || (git commit -m "Update CIS52 schedule" && git push) |