Skip to content

Commit c5d2ba4

Browse files
authored
docs: publish to GitHub pages (#4027)
* docs: remove old versioned docs * ci: Add action to publish docs to GH pages * docs: update outdated config * ci: set base URL
1 parent f3e7f98 commit c5d2ba4

File tree

1,383 files changed

+77
-162279
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

1,383 files changed

+77
-162279
lines changed

.github/workflows/docs-publish.yml

Lines changed: 71 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,71 @@
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: Preview docs
28+
runs-on: ubuntu-24.04
29+
if: (github.repository_owner == github.event.pull_request.head.repo.owner.login) && (github.event_name == 'pull_request')
30+
steps:
31+
- name: Checkout
32+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
33+
with:
34+
persist-credentials: false
35+
36+
- name: Set base URL
37+
run: |
38+
sed -i "s|baseUrl: '/constellation/'|baseUrl: '/constellation/pr-preview/pr-${{ github.event.number }}/'|" ./docs/docusaurus.config.js
39+
40+
- name: Build
41+
working-directory: ./docs
42+
run: |
43+
npm i && npm run build
44+
45+
- name: Deploy Preview
46+
uses: rossjrw/pr-preview-action@8ff09e486b4c23709012eedd3b42e9f0b95dd0c5 # v1.6.3
47+
with:
48+
source-dir: ./docs/build
49+
50+
publish:
51+
name: Publish docs to GitHub Pages
52+
runs-on: ubuntu-24.04
53+
if: github.event_name == 'push' && github.ref_name == 'main'
54+
steps:
55+
- name: Checkout
56+
uses: actions/checkout@93cb6efe18208431cddfb8368fd83d5badbf9bfd # v5.0.1
57+
with:
58+
persist-credentials: false
59+
60+
- name: Build
61+
working-directory: ./docs
62+
run: |
63+
npm i && npm run build
64+
65+
- name: Publish
66+
uses: JamesIves/github-pages-deploy-action@4a3abc783e1a24aeb44c16e869ad83caf6b4cc23 # v4.7.4
67+
with:
68+
folder: ./docs/build
69+
branch: gh-pages
70+
clean-exclude: pr-preview
71+
force: false

docs/docusaurus.config.js

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,6 @@ async function createConfig() {
1212
url: 'https://docs.edgeless.systems',
1313
baseUrl: '/constellation/',
1414
onBrokenLinks: 'throw',
15-
onBrokenMarkdownLinks: 'throw',
1615
onBrokenAnchors: 'throw',
1716
favicon: 'img/favicon.ico',
1817

@@ -41,6 +40,9 @@ async function createConfig() {
4140
// mermaid
4241
markdown: {
4342
mermaid: true,
43+
hooks: {
44+
onBrokenMarkdownLinks: 'throw',
45+
},
4446
},
4547
themes: ['@docusaurus/theme-mermaid'],
4648

docs/package-lock.json

Lines changed: 1 addition & 36 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
-20.6 KB
Binary file not shown.
-18.4 KB
Binary file not shown.
-19.4 KB
Binary file not shown.
-22.4 KB
Binary file not shown.
-14.5 KB
Binary file not shown.

0 commit comments

Comments
 (0)