Skip to content

Delete Lab-01-DDA-Line/output_gui.png #1

Delete Lab-01-DDA-Line/output_gui.png

Delete Lab-01-DDA-Line/output_gui.png #1

name: Generate Output Docs
# ─────────────────────────────────────────────
# TRIGGER: runs whenever output_*.png files are
# pushed to any Lab-* folder
# ─────────────────────────────────────────────
on:
push:
paths:
- 'Lab-*/output_*.png'
- 'Lab-*/outputzoomed.png'
jobs:
build-docs:
runs-on: ubuntu-latest
steps:
# Step 1: Download the repo onto the Ubuntu machine
- name: Checkout repository
uses: actions/checkout@v3
# Step 2: Install Python
- name: Set up Python
uses: actions/setup-python@v4
with:
python-version: '3.11'
# Step 3: Install python-docx library
- name: Install dependencies
run: pip install python-docx
# Step 4: Create the CG-Lab-Outputs folder if it doesn't exist
- name: Create output directory
run: mkdir -p CG-Lab-Outputs
# Step 5: Run the script — generates all docx files
- name: Run generate_output_doc.py
run: python generate_output_doc.py
# Step 6: Commit and push the generated docx files back to the repo
- name: Commit and push output docs
run: |
git config user.name "github-actions[bot]"
git config user.email "github-actions[bot]@users.noreply.github.com"
git add CG-Lab-Outputs/
git diff --staged --quiet || git commit -m "Auto-generate output docs [skip ci]"
git push
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}