Update Stats #8
This file contains hidden or 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 Stats | |
| on: | |
| schedule: | |
| # Run every Sunday at 2 AM UTC | |
| - cron: '0 2 * * 0' | |
| workflow_dispatch: # Allow manual triggering | |
| jobs: | |
| update-plots: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: write | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v4 | |
| - name: Set up Python | |
| uses: actions/setup-python@v5 | |
| - name: Install uv | |
| uses: astral-sh/setup-uv@v3 | |
| - name: Clone MultiQC repository | |
| run: git clone https://github.com/MultiQC/MultiQC.git /tmp/multiqc-repo | |
| - name: Generate updated plots | |
| run: | | |
| uv run generate_plots.py /tmp/multiqc-repo | |
| uv run generate_github_stats.py MultiQC/MultiQC --token ${{ secrets.GITHUB_TOKEN }} | |
| - name: Check for changes | |
| id: verify-changed-files | |
| run: | | |
| if [ -n "$(git status --porcelain)" ]; then | |
| echo "changed=true" >> $GITHUB_OUTPUT | |
| echo "Files have changed" | |
| else | |
| echo "changed=false" >> $GITHUB_OUTPUT | |
| echo "No changes detected" | |
| fi | |
| - name: Commit and push changes | |
| if: steps.verify-changed-files.outputs.changed == 'true' | |
| run: | | |
| git config --global user.name 'github-actions[bot]' | |
| git config --global user.email 'github-actions[bot]@users.noreply.github.com' | |
| git add plots/ data/ .cache/ | |
| git commit -m "Update MultiQC statistics plots" | |
| git push |