diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml index cad7e5e..e65c8b6 100644 --- a/.github/workflows/docs.yaml +++ b/.github/workflows/docs.yaml @@ -28,7 +28,13 @@ on: workflow_dispatch: permissions: - contents: write + contents: read + pages: write + id-token: write + +concurrency: + group: pages + cancel-in-progress: true jobs: docs: @@ -39,6 +45,9 @@ jobs: with: fetch-depth: 0 + - name: Configure GitHub Pages + uses: actions/configure-pages@v5 + - name: Set up Hugo uses: peaceiris/actions-hugo@v3 with: @@ -47,10 +56,19 @@ jobs: - name: Build documentation site run: hugo build --gc --minify - - name: Deploy documentation site - if: github.event_name == 'push' && github.ref == 'refs/heads/main' - uses: JamesIves/github-pages-deploy-action@v4 + - name: Upload documentation artifact + uses: actions/upload-pages-artifact@v4 with: - branch: gh-pages - folder: public - clean: true + path: public + + deploy: + if: github.event_name == 'push' && github.ref == 'refs/heads/main' + needs: docs + runs-on: ubuntu-latest + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + steps: + - name: Deploy documentation site + id: deployment + uses: actions/deploy-pages@v4 diff --git a/content/docs/release.md b/content/docs/release.md index c382210..1ab7e1e 100644 --- a/content/docs/release.md +++ b/content/docs/release.md @@ -3,7 +3,7 @@ title: "Release Process" weight: 4 --- -The repository tracks release notes in `docs/RELEASE.md`, automates tagged releases with GitHub Actions, and publishes the documentation site through `gh-pages`. +The repository tracks release notes in `docs/RELEASE.md`, automates tagged releases with GitHub Actions, and publishes the documentation site through GitHub Pages Actions. ## Commands @@ -27,9 +27,9 @@ After the tag is pushed, verify that the `Release` workflow succeeds and that th The documentation workflow lives in `.github/workflows/docs.yaml`. -When a docs-related change is pushed to `main`, GitHub Actions builds the Hugo site and deploys the generated `public/` directory to the `gh-pages` branch. +When a docs-related change is pushed to `main`, GitHub Actions builds the Hugo site, uploads the generated `public/` directory as a Pages artifact, and deploys it through GitHub Pages. -For this to publish correctly, repository settings must point GitHub Pages at the `gh-pages` branch root. +For this to publish correctly, repository settings must point GitHub Pages at GitHub Actions. After a merge, verify that the `Docs` workflow succeeds and that the site is available at `https://skyoo2003.github.io/kvs/`. diff --git a/docs/RELEASE.md b/docs/RELEASE.md index 6d96e04..88f7cdc 100644 --- a/docs/RELEASE.md +++ b/docs/RELEASE.md @@ -37,7 +37,7 @@ After pushing the tag, confirm that the `Release` workflow succeeds and that the ## Documentation Site Release -The static documentation site is built with Hugo and published to the `gh-pages` branch. +The static documentation site is built with Hugo and published through GitHub Pages Actions. ### Trigger @@ -56,11 +56,12 @@ The docs workflow runs on pushes to `main` when one of these paths changes: 1. GitHub Actions runs `.github/workflows/docs.yaml` 2. Hugo builds the site into `public/` -3. `JamesIves/github-pages-deploy-action` publishes `public/` to the `gh-pages` branch +3. `actions/upload-pages-artifact` uploads `public/` as the Pages artifact +4. `actions/deploy-pages` publishes that artifact to GitHub Pages ### Repository Setting -GitHub Pages must be configured to serve from the `gh-pages` branch root. +GitHub Pages must be configured to deploy from GitHub Actions. ### Verification