Skip to content

Fix schema workflow and publish to GitHub Pages - #2

Closed
GamelinAl wants to merge 1 commit into
update-schemas-automaticallyfrom
fix-schema-workflow
Closed

GamelinAl wants to merge 1 commit into
update-schemas-automaticallyfrom
fix-schema-workflow

Conversation

@GamelinAl

Copy link
Copy Markdown
Member

.github/workflows/update-schemas.yml (main change)

  • Script call: it now uses the real name, scripts/generate-schemas.py, and passes --output site/, so each version builds into its own folder.
  • Two jobs: the single job is split into build and deploy.
  • build: generates release and main and uploads each as an artifact. With fail-fast: false, one failing doesn't cancel the other.
  • deploy: publishes both versions to GitHub Pages, which avoids pushing to the protected main.
    • If a version fails to build, it keeps its last published schema, so a bad build can't remove it from the site.
    • It only deploys when a schema has changed, and it fails if nothing was built.
  • Triggers: a pull_request trigger now runs build only, when the workflow, scripts or requirements change. The workflow can therefore be tested before merge.
  • Permissions: the workflow default is reduced to contents: read. Only deploy gets pages: write and id-token: write.

requirements-release.txt

  • pyaml is replaced with accelerator-middle-layer, because pyaml on PyPI is an unrelated package that clashes with ours.

schemas/accelerator.schema.json

  • Restored after the PR deleted it, so the URL in the docs keeps working. It's now frozen and no longer updated.

README.md

  • Adds the release and main Pages URLs, explains the frozen file, and shows how to generate schemas locally.

- Call the script by its real name and pass the required --output.
- Install accelerator-middle-layer: "pyaml" on PyPI is an unrelated
  package that also installs into site-packages/pyaml.
- Build each version into its own directory and publish both with a
  single deploy job, since main is protected against direct pushes.
- Keep building the other version if one fails, and keep the last
  published schema of the failed one.
- Only deploy when a schema changed.
- Run the build on pull requests so the workflow can be tested before
  merging.
- Restore schemas/accelerator.schema.json, which the documentation
  still links to, and document the new URLs in the README.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants