From 0ae8883585a700c4f515ec821e38bde55e9c6657 Mon Sep 17 00:00:00 2001 From: Gregory Mermoud Date: Wed, 18 Mar 2026 15:42:26 +0100 Subject: [PATCH 1/2] fix(ci): verify index.html in PR instead of pushing post-merge The previous workflow pushed the rebuilt index.html directly to main, which failed silently due to branch protection. Switch to a pre-merge check: contributors run build.py locally and include index.html in their PR; CI fails if the committed HTML is stale. Also rebuilds index.html to include Marc Gillioz's updated profile, which was lost when the post-merge CI pushes were rejected. --- .github/workflows/build.yml | 20 +++---- README.md | 108 ++++++++++++++++++++++++++++++++++++ index.html | 10 ++-- 3 files changed, 120 insertions(+), 18 deletions(-) create mode 100644 README.md diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 443a647..60dc96e 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -1,18 +1,17 @@ name: Build site on: - push: + pull_request: branches: [main] paths: - "data/**.md" - "assets/team/**" - "build.py" + - "index.html" jobs: - build: + check: runs-on: ubuntu-latest - permissions: - contents: write steps: - uses: actions/checkout@v4 @@ -22,14 +21,9 @@ jobs: - name: Regenerate index.html run: uv run build.py - - name: Commit updated index.html + - name: Verify index.html is up-to-date run: | - git config user.name "github-actions[bot]" - git config user.email "github-actions[bot]@users.noreply.github.com" - git diff --quiet index.html || ( - git add index.html && - git commit -m "chore: rebuild site [skip ci]" + git diff --exit-code index.html || ( + echo "index.html is out of date. Run 'python build.py' locally and include the result in your PR." + exit 1 ) - - - name: Push - run: git push diff --git a/README.md b/README.md new file mode 100644 index 0000000..90d0f4d --- /dev/null +++ b/README.md @@ -0,0 +1,108 @@ +# Publishing the SIMLab Website + +The website at [simlab-vs.github.io](https://simlab-vs.github.io) is generated from +two plain-text Markdown files and a Python build script. No build tools, no +dependencies, no framework. + +## How it works + +``` +data/projects.md ─┐ +data/collaborators.md ─┤──► build.py ──► index.html ──► GitHub Pages +index.html (template) ─┘ +``` + +`build.py` parses the Markdown files and injects the generated HTML between +marker comments in `index.html`. GitHub Pages then serves `index.html` directly +from the `main` branch. + +## Editing content + +### Projects — `data/projects.md` + +Each project is a `## Heading` block followed by optional `key: value` fields +and a free-form description paragraph: + +```markdown +## Project Title +funding: Horizon # Horizon | SNSF | Innosuisse | HES-SO (or any string) +period: 2024–2027 +partners: EPFL, WSL +github: https://github.com/simlab-vs/my-project +status: ongoing # ongoing | completed + +One or more sentences describing the project. Wrap long lines freely — +the script joins them into a single paragraph. +``` + +All fields are optional. Only the `## Title` is required. + +### Collaborators — `data/collaborators.md` + +```markdown +## Full Name +title: Associate Professor +affiliation: EPFL +website: https://example.com +email: name@example.com # optional, not displayed publicly + +One or two sentences of bio. +``` + +### Funding badge colours + +| Value | Badge colour | +|------------|-------------| +| Horizon | Blue | +| SNSF | Green | +| Innosuisse | Amber | +| HES-SO | Purple | +| other | Grey | + +## Rebuilding locally + +Requires [uv](https://docs.astral.sh/uv/). No other dependencies. + +```bash +# First time: create the virtual environment +uv sync + +# Rebuild index.html in-place +uv run build.py + +# Preview generated HTML without touching index.html +uv run build.py --check + +# Use a different data directory or output file +uv run build.py --data path/to/data --output path/to/index.html +``` + +## Publishing + +All changes go through a pull request. The CI checks that `index.html` is +up-to-date with the data files — if it isn't, the PR check fails. + +**Workflow for contributors:** + +1. Edit files under `data/` (or `build.py`). +2. Run `uv run build.py` to regenerate `index.html`. +3. Commit both the data change and the updated `index.html`. +4. Open a pull request — the CI will verify the HTML matches the data. + +```bash +# Edit your data file, then: +uv run build.py +git add data/team/your-name.md index.html +git commit -m "feat(team): update your-name profile" +git push origin your-branch +``` + +## Adding a new section to the site + +1. Create `data/mysection.md` with the same `## heading` + fields + body format. +2. Add `` / `` markers in + `index.html` where the section should appear. +3. Add CSS for the new section directly in `index.html`. +4. Add a `parse_mysection` / `render_mysection` / `build_mysection_html` + function trio in `build.py` following the existing pattern, and call + `inject(text, "mysection", ...)` in `main()`. diff --git a/index.html b/index.html index 0f78f8d..e373cfa 100644 --- a/index.html +++ b/index.html @@ -634,10 +634,10 @@

Glory Givi

MG
-

Marc Gillioz

-
Scientist
+

Dr. Marc Gillioz

+
Senior scientist
Deep LearningTime SeriesIndustrial Applications
- +

Marc is currently working on projects related to hydroelectric power production, in particular applying data analysis and machine learning techniques to: - predict strain and fatigue for variable-speed turbines, - detect anomalies in operational data for better maintenance planning. At the HES-SO, Marc has also worked on problems related to power systems, such as power flow optimization through topological changes, modelling of hydroelectric production and high-voltage grids, and network reconstruction using Smart Meter data. Marc's background is in high-energy physics, with a stint in software engineering.

@@ -661,9 +661,9 @@

Marta Rende

DO
-

Dion Osmani

+

Dion Osmani

Assistant
- +
Dynamic SystemsOptimization
From f2fbcefdb617efec61f188f4364ccc6726ad2323 Mon Sep 17 00:00:00 2001 From: Gregory Mermoud Date: Wed, 18 Mar 2026 15:47:52 +0100 Subject: [PATCH 2/2] fix(ci): auto-commit rebuilt index.html to PR branch Replace the verify-only check with a build job that regenerates index.html and commits it back to the PR branch. Contributors no longer need to run build.py locally. --- .github/workflows/build.yml | 18 ++++++++++++------ README.md | 14 ++++++-------- 2 files changed, 18 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 60dc96e..4307040 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -7,23 +7,29 @@ on: - "data/**.md" - "assets/team/**" - "build.py" - - "index.html" jobs: - check: + build: runs-on: ubuntu-latest + permissions: + contents: write steps: - uses: actions/checkout@v4 + with: + ref: ${{ github.head_ref }} - uses: astral-sh/setup-uv@v5 - name: Regenerate index.html run: uv run build.py - - name: Verify index.html is up-to-date + - name: Commit updated index.html run: | - git diff --exit-code index.html || ( - echo "index.html is out of date. Run 'python build.py' locally and include the result in your PR." - exit 1 + git config user.name "github-actions[bot]" + git config user.email "github-actions[bot]@users.noreply.github.com" + git diff --quiet index.html || ( + git add index.html && + git commit -m "chore: rebuild index.html [skip ci]" && + git push ) diff --git a/README.md b/README.md index 90d0f4d..88e91b0 100644 --- a/README.md +++ b/README.md @@ -79,20 +79,18 @@ uv run build.py --data path/to/data --output path/to/index.html ## Publishing -All changes go through a pull request. The CI checks that `index.html` is -up-to-date with the data files — if it isn't, the PR check fails. +All changes go through a pull request. CI automatically rebuilds `index.html` +and commits it to your PR branch — no local build step required. **Workflow for contributors:** 1. Edit files under `data/` (or `build.py`). -2. Run `uv run build.py` to regenerate `index.html`. -3. Commit both the data change and the updated `index.html`. -4. Open a pull request — the CI will verify the HTML matches the data. +2. Commit and push your changes. +3. Open a pull request — CI will regenerate `index.html` and push a + `chore: rebuild index.html` commit to your branch automatically. ```bash -# Edit your data file, then: -uv run build.py -git add data/team/your-name.md index.html +git add data/team/your-name.md git commit -m "feat(team): update your-name profile" git push origin your-branch ```