Skip to content

Commit 64984b9

Browse files
Add documentation (#153)
1 parent 60d8acb commit 64984b9

File tree

17 files changed

+4510
-1
lines changed

17 files changed

+4510
-1
lines changed

.github/workflows/publish-docs.yml

Lines changed: 62 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,62 @@
1+
# SPDX-FileCopyrightText: 2026 SAP SE or an SAP affiliate company and IronCore contributors
2+
# SPDX-License-Identifier: Apache-2.0
3+
4+
name: Documentation
5+
6+
on:
7+
push:
8+
branches: [main]
9+
pull_request:
10+
types: [ assigned, opened, synchronize, reopened ]
11+
workflow_dispatch:
12+
13+
permissions:
14+
contents: read
15+
pages: write
16+
id-token: write
17+
18+
concurrency:
19+
group: pages
20+
cancel-in-progress: false
21+
22+
jobs:
23+
build:
24+
name: Build VitePress Site
25+
runs-on: ubuntu-latest
26+
steps:
27+
- name: Checkout
28+
uses: actions/checkout@v6
29+
with:
30+
fetch-depth: 0
31+
- name: Setup Node
32+
uses: actions/setup-node@v6
33+
with:
34+
node-version: 25
35+
cache: npm
36+
cache-dependency-path: docs/package-lock.json
37+
- name: Setup Pages
38+
uses: actions/configure-pages@v5
39+
- name: Install dependencies
40+
working-directory: docs
41+
run: npm ci
42+
- name: Build with VitePress
43+
working-directory: docs
44+
run: npm run docs:build
45+
- name: Upload artifact
46+
uses: actions/upload-pages-artifact@v4
47+
if: github.event_name != 'pull_request'
48+
with:
49+
path: docs/.vitepress/dist
50+
51+
deploy:
52+
name: Publish GitHub Pages
53+
needs: build
54+
runs-on: ubuntu-latest
55+
if: github.event_name != 'pull_request'
56+
environment:
57+
name: github-pages
58+
url: ${{ steps.deployment.outputs.page_url }}
59+
steps:
60+
- name: Deploy to GitHub Pages
61+
id: deployment
62+
uses: actions/deploy-pages@v4

Makefile

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,6 +167,13 @@ docker-push-test-lab: FORCE docker-push-test-lab
167167
@printf "\e[1;36m>> $(CONTAINER_TOOL) push $(TEST_LAB_IMG)\e[0m\n"
168168
@$(CONTAINER_TOOL) push $(TEST_LAB_IMG)
169169

170+
ROOT_DIR := $(shell pwd)
171+
DOCS_IMG ?= ironcore-dev/network-operator-docs:latest
172+
173+
run-docs:
174+
@docker build -t $(DOCS_IMG) -f docs/Dockerfile docs --load
175+
@docker run --rm --init -p 5173:5173 -v $(ROOT_DIR)/docs:/workspace -v /workspace/node_modules $(DOCS_IMG)
176+
170177
install-goimports: FORCE
171178
@if ! hash goimports 2>/dev/null; then printf "\e[1;36m>> Installing goimports (this may take a while)...\e[0m\n"; go install golang.org/x/tools/cmd/goimports@latest; fi
172179

@@ -259,7 +266,7 @@ run-typos: FORCE install-typos
259266

260267
build/cover.out: FORCE generate install-setup-envtest | build
261268
@printf "\e[1;36m>> Running tests\e[0m\n"
262-
KUBEBUILDER_ASSETS=$$(setup-envtest use 1.32 -p path) go run github.com/onsi/ginkgo/v2/ginkgo run --randomize-all -output-dir=build $(GO_BUILDFLAGS) -ldflags '-s -w -X github.com/sapcc/go-api-declarations/bininfo.binName=network-operator -X github.com/sapcc/go-api-declarations/bininfo.version=$(BININFO_VERSION) -X github.com/sapcc/go-api-declarations/bininfo.commit=$(BININFO_COMMIT_HASH) -X github.com/sapcc/go-api-declarations/bininfo.buildDate=$(BININFO_BUILD_DATE) $(GO_LDFLAGS)' -covermode=count -coverpkg=$(subst $(space),$(comma),$(GO_COVERPKGS)) $(GO_TESTFLAGS) $(GO_TESTPKGS)
269+
KUBEBUILDER_ASSETS=$$(setup-envtest use 1.35 -p path) go run github.com/onsi/ginkgo/v2/ginkgo run --randomize-all -output-dir=build $(GO_BUILDFLAGS) -ldflags '-s -w -X github.com/sapcc/go-api-declarations/bininfo.binName=network-operator -X github.com/sapcc/go-api-declarations/bininfo.version=$(BININFO_VERSION) -X github.com/sapcc/go-api-declarations/bininfo.commit=$(BININFO_COMMIT_HASH) -X github.com/sapcc/go-api-declarations/bininfo.buildDate=$(BININFO_BUILD_DATE) $(GO_LDFLAGS)' -covermode=count -coverpkg=$(subst $(space),$(comma),$(GO_COVERPKGS)) $(GO_TESTFLAGS) $(GO_TESTPKGS)
263270
@awk < build/coverprofile.out '$$1 != "mode:" { is_filename[$$1] = true; counts1[$$1]+=$$2; counts2[$$1]+=$$3 } END { for (filename in is_filename) { printf "%s %d %d\n", filename, counts1[filename], counts2[filename]; } }' | sort | $(SED) '1s/^/mode: count\n/' > $@
264271

265272
build/cover.html: build/cover.out

Makefile.maker.yaml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,3 +193,10 @@ verbatim: |
193193
docker-push-test-lab: FORCE docker-push-test-lab
194194
@printf "\e[1;36m>> $(CONTAINER_TOOL) push $(TEST_LAB_IMG)\e[0m\n"
195195
@$(CONTAINER_TOOL) push $(TEST_LAB_IMG)
196+
197+
ROOT_DIR := $(shell pwd)
198+
DOCS_IMG ?= ironcore-dev/network-operator-docs:latest
199+
200+
run-docs:
201+
@docker build -t $(DOCS_IMG) -f docs/Dockerfile docs --load
202+
@docker run --rm --init -p 5173:5173 -v $(ROOT_DIR)/docs:/workspace -v /workspace/node_modules $(DOCS_IMG)

docs/.dockerignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
# More info: https://docs.docker.com/engine/reference/builder/#dockerignore-file
2+
node_modules/

docs/.gitignore

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
node_modules
2+
.vitepress/dist
3+
.vitepress/cache

docs/.prettierrc

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,5 @@
1+
semi: false
2+
tabWidth: 4
3+
printWidth: 120
4+
singleQuote: true
5+
trailingComma: 'es5'

docs/.vitepress/config.mts

Lines changed: 80 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,80 @@
1+
import { withMermaid } from 'vitepress-plugin-mermaid'
2+
import { fileURLToPath, URL } from 'node:url'
3+
4+
// https://vitepress.dev/reference/site-config
5+
export default withMermaid({
6+
title: 'Network Operator',
7+
description: 'Cloud Native Network Device Provisioning',
8+
base: "/network-operator/",
9+
head: [
10+
[
11+
'link',
12+
{
13+
rel: 'icon',
14+
href: 'https://raw.githubusercontent.com/ironcore-dev/network-operator/refs/heads/docs/docs/assets/network-operator-logo.png',
15+
},
16+
],
17+
],
18+
vite: {
19+
resolve: {
20+
alias: [
21+
{
22+
find: /^.*\/VPFooter\.vue$/,
23+
replacement: fileURLToPath(new URL('./theme/components/VPFooter.vue', import.meta.url)),
24+
},
25+
],
26+
},
27+
},
28+
themeConfig: {
29+
// https://vitepress.dev/reference/default-theme-config
30+
nav: [
31+
{ text: 'Home', link: '/' },
32+
{
33+
text: 'Documentation',
34+
items: [
35+
{ text: 'Overview', link: '/overview' },
36+
{ text: 'API References', link: '/api/' },
37+
],
38+
},
39+
{
40+
text: 'Projects',
41+
items: [
42+
{ text: 'ApeiroRA', link: 'https://apeirora.eu/' },
43+
{ text: 'IronCore', link: 'https://ironcore.dev/' },
44+
{
45+
text: 'CobaltCore',
46+
link: 'https://cobaltcore-dev.github.io/docs/',
47+
},
48+
],
49+
},
50+
],
51+
52+
editLink: {
53+
pattern: 'https://github.com/ironcore-dev/network-operator/blob/main/docs/:path',
54+
text: 'Edit this page on GitHub',
55+
},
56+
57+
logo: {
58+
src: 'https://raw.githubusercontent.com/ironcore-dev/network-operator/refs/heads/docs/docs/assets/network-operator-logo.png',
59+
width: 24,
60+
height: 24,
61+
},
62+
63+
search: {
64+
provider: 'local',
65+
},
66+
67+
sidebar: [
68+
{
69+
text: 'Overview',
70+
items: [{ text: 'Index', link: '/overview/' }],
71+
},
72+
{
73+
text: 'API References',
74+
items: [{ text: 'Index', link: '/api/' }],
75+
},
76+
],
77+
78+
socialLinks: [{ icon: 'github', link: 'https://github.com/ironcore-dev/network-operator' }],
79+
},
80+
})

0 commit comments

Comments
 (0)