Skip to content
This repository was archived by the owner on Jan 22, 2026. It is now read-only.

Commit 78d9c3e

Browse files
committed
ci: Add action to publish docs to GH pages
1 parent a4059d5 commit 78d9c3e

File tree

1 file changed

+67
-0
lines changed

1 file changed

+67
-0
lines changed

.github/workflows/docs-publish.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Publish docs to GitHub Pages
2+
3+
on:
4+
workflow_dispatch:
5+
push:
6+
branches:
7+
- main
8+
paths:
9+
- docs/**
10+
- .github/workflows/docs_publish.yml
11+
pull_request:
12+
types:
13+
- opened
14+
- reopened
15+
- synchronize
16+
- closed
17+
paths:
18+
- docs/**
19+
- .github/workflows/docs_publish.yml
20+
21+
permissions:
22+
contents: write
23+
pull-requests: write
24+
25+
jobs:
26+
preview:
27+
name: Publish docs to GitHub Pages
28+
runs-on: ubuntu-24.04
29+
if: github.event_name == 'push' && github.ref_name == 'main'
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
33+
with:
34+
persist-credentials: false
35+
36+
- name: Build
37+
working-directory: ./docs
38+
run: |
39+
npm run build
40+
41+
- name: Deploy Preview
42+
uses: rossjrw/pr-preview-action@8ff09e486b4c23709012eedd3b42e9f0b95dd0c5 # v1.6.3
43+
with:
44+
source-dir: ./docs/build
45+
46+
publish:
47+
name: Publish docs to GitHub Pages
48+
runs-on: ubuntu-24.04
49+
if: github.event_name == 'push' && github.ref_name == 'main'
50+
steps:
51+
- name: Checkout
52+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
53+
with:
54+
persist-credentials: false
55+
56+
- name: Build
57+
working-directory: ./docs
58+
run: |
59+
npm run build
60+
61+
- name: Publish
62+
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4.7.4
63+
with:
64+
folder: ./docs/build
65+
branch: gh-pages
66+
clean-exclude: pr-preview
67+
force: false

0 commit comments

Comments
 (0)