diff --git a/.github/workflows/deploy-pages.yml b/.github/workflows/deploy-pages.yml index a12c95f..f88e23d 100644 --- a/.github/workflows/deploy-pages.yml +++ b/.github/workflows/deploy-pages.yml @@ -1,12 +1,11 @@ name: Deploy website to GitHub Pages on: + # Deploy on every push to main (no path filter) so the published site is always + # the built website, even after commits that only touch the backend or docs. push: branches: - main - paths: - - website/** - - .github/workflows/deploy-pages.yml workflow_dispatch: permissions: @@ -32,6 +31,21 @@ jobs: # website is published instead of the Jekyll-rendered README. enablement: true + - name: Ensure Pages build type is GitHub Actions + # When Pages was previously configured with the "Deploy from a branch" + # source, GitHub keeps running the legacy Jekyll build, which republishes + # the README over this workflow's deployment. Force the build type back to + # "workflow" so only the built website is served. + env: + GH_TOKEN: ${{ github.token }} + run: | + gh api \ + --method PUT \ + -H "Accept: application/vnd.github+json" \ + "/repos/${GITHUB_REPOSITORY}/pages" \ + -f build_type=workflow \ + || echo "Could not update the Pages build type; set Settings > Pages > Source to 'GitHub Actions' manually." + - name: Setup Node.js uses: actions/setup-node@v4 with: diff --git a/README.md b/README.md index ec4c6ed..55a2610 100644 --- a/README.md +++ b/README.md @@ -64,12 +64,13 @@ for ten backend languages, practical tips, and an interactive API Explorer that runs requests against this service. The site is published with GitHub Pages at -. Changes under `website/` are deployed -automatically when they are merged to `main` by the +. Every push to `main` is deployed by the [`Deploy website to GitHub Pages`](.github/workflows/deploy-pages.yml) workflow; the workflow can also be run manually from the Actions tab. The workflow enables -Pages and sets its source to GitHub Actions on the first run, so no manual -repository setup is required. +Pages and forces its build type to GitHub Actions, so the built website — not the +Jekyll-rendered README — is what gets served. If the deployment ever fails to +update the Pages configuration, set **Settings → Pages → Source** to +**GitHub Actions** once and re-run the workflow. ```bash cd website