diff --git a/.github/workflows/site.yml b/.github/workflows/site.yml new file mode 100644 index 0000000..f704619 --- /dev/null +++ b/.github/workflows/site.yml @@ -0,0 +1,35 @@ +name: Site + +# Builds the documentation site and publishes it to GitHub Pages from main, +# serving at https://jlt-commons.github.io/raylib-android/. +# +# The build itself lives in jlt-commons/ci-builds, shared by every project so +# the scaffolding is fixed in one place. What stays here is what is actually +# this project's: the content under docs/, its config in docs/site.edn, the +# base path below, and the assertions in docs/check-site.sh. +# +on: + push: + branches: [main] + pull_request: + workflow_dispatch: + +permissions: + contents: read + +# Deploys must not race, and a half-applied Pages deployment is worse than a +# slightly stale one, so main is never cancelled. Pull request builds are +# scoped per ref and cancel their own earlier runs. +concurrency: + group: site-${{ github.ref }} + cancel-in-progress: ${{ github.ref != 'refs/heads/main' }} + +jobs: + site: + uses: jlt-commons/ci-builds/.github/workflows/site.yml@main + with: + base-path: /raylib-android + permissions: + contents: read + pages: write + id-token: write diff --git a/docs/check-site.sh b/docs/check-site.sh index bbd03f8..d59b886 100755 --- a/docs/check-site.sh +++ b/docs/check-site.sh @@ -1,15 +1,10 @@ #!/usr/bin/env bash # Assertions this project's documentation build must satisfy. # -# NOTHING IN CI RUNS THIS at the moment. The site workflow that did -- a call -# into the shared one in jlt-commons/ci-builds -- was removed while this -# repository is private, because GitHub Pages is unavailable for a private -# repository on this plan and its deploy job therefore failed on every push. -# Restoring it means restoring .github/workflows/site.yml, which is one call to -# jlt-commons/ci-builds/.github/workflows/site.yml@main with -# base-path: /raylib-android. +# Run by the shared site workflow in jlt-commons/ci-builds against the freshly +# built _site, with BASE_PATH exported. # -# So run it by hand, from a docs-engine checkout: +# Run it locally the same way, from a docs-engine checkout: # bb build && cd \ # && BASE_PATH=/raylib-android bash docs/check-site.sh diff --git a/docs/site.edn b/docs/site.edn index ad326b0..f744f4e 100644 --- a/docs/site.edn +++ b/docs/site.edn @@ -2,13 +2,9 @@ ;; docs-engine (https://github.com/jlt-commons/docs-engine). ;; ;; Build it locally from a docs-engine checkout with `bb build `, -;; or `bb serve ` to preview. -;; -;; NOTHING PUBLISHES IT at the moment. The workflow that did was removed while -;; this repository is private: GitHub Pages is unavailable for a private -;; repository on this plan, so its deploy step failed on every push. This file -;; and everything it configures are kept ready for the day it is restored, -;; which is one call to jlt-commons/ci-builds/.github/workflows/site.yml@main. +;; or `bb serve ` to preview. CI builds and publishes it from +;; .github/workflows/site.yml, which calls the shared workflow in +;; jlt-commons/ci-builds. {;; :base-path is what makes this a project site rather than an org one. The ;; site is served at https://jlt-commons.github.io/raylib-android/, so every URL ;; the engine emits needs that prefix. Leave it out and the pages still