Skip to content

Generate Lesson Statistics #4788

Generate Lesson Statistics

Generate Lesson Statistics #4788

name: Generate Lesson Statistics
on:
push:
branches: main
schedule:
- cron: '45 */6 * * *'
workflow_dispatch:
inputs:
name:
description: 'Who triggered this build?'
required: true
default: 'scheduled build'
jobs:
build-website:
if: github.repository_owner == 'carpentries-incubator'
runs-on: ubuntu-latest
defaults:
run:
shell: bash
steps:
- name: Checkout the Repository
uses: actions/checkout@v2
- name: Run stats script
if: ${{ github.ref == 'refs/heads/main' }}
run: |
python bin/get_lesson_stats.py ${{ secrets.PAT_USERNAME }} ${{ secrets.PAT }} > _data/lesson-stats.yml
git config --local user.email "[email protected]"
git config --local user.name "GitHub Actions"
git pull origin main
git add _data/lesson-stats.yml
git commit -m "[Github Actions] update lesson stats (via ${{ github.sha }})" || echo "Nothing to commit"
git push origin main