Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
32 changes: 25 additions & 7 deletions .github/workflows/docs.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand All @@ -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:
Expand All @@ -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
6 changes: 3 additions & 3 deletions content/docs/release.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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/`.

Expand Down
7 changes: 4 additions & 3 deletions docs/RELEASE.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand All @@ -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

Expand Down
Loading