Skip to content

Commit 4d6adbb

Browse files
authored
ci(docs): replace hugo with mkdocs (#261)
1 parent 90c4011 commit 4d6adbb

Some content is hidden

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

83 files changed

+1098
-3419
lines changed

.github/workflows/pages.yaml

+7-32
Original file line numberDiff line numberDiff line change
@@ -11,43 +11,18 @@ jobs:
1111
runs-on: ubuntu-latest
1212

1313
steps:
14-
- name: Fetch Hugo theme
14+
- name: Checkout
1515
uses: actions/checkout@v3
16-
with:
17-
submodules: recursive
18-
fetch-depth: 0
19-
20-
- name: Setup Go
21-
uses: actions/setup-go@v2
22-
with:
23-
go-version: '1.18'
24-
25-
- name: Setup Hugo
26-
uses: peaceiris/actions-hugo@v2
27-
with:
28-
hugo-version: '0.110.0'
29-
extended: true
30-
31-
- name: Setup Node
32-
uses: actions/setup-node@v3
33-
with:
34-
node-version: '18'
35-
36-
- name: Install npm deps
37-
uses: actions/cache@v1
38-
with:
39-
path: ~/.npm
40-
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
41-
restore-keys: |
42-
${{ runner.os }}-node-
4316

4417
- name: Generate docs
45-
run: |
46-
npm ci --prefix ./docs
47-
make generate-docs
18+
uses: addnab/docker-run-action@v3
19+
with:
20+
image: squidfunk/mkdocs-material:latest
21+
options: -v ${{ github.workspace }}/docs/:/docs
22+
run: mkdocs build
4823

4924
- name: Deploy
5025
uses: peaceiris/actions-gh-pages@v3
5126
with:
5227
github_token: ${{ secrets.GITHUB_TOKEN }}
53-
publish_dir: ./docs/public
28+
publish_dir: ./docs/site

.gitignore

+1-4
Original file line numberDiff line numberDiff line change
@@ -35,10 +35,7 @@ bundle-*
3535
hack/tools/bin/*
3636

3737
# Docs
38-
docs/node_modules
39-
docs/public
40-
docs/resources
41-
docs/content/en/docs/api-reference/_index.md
38+
docs/site
4239

4340
# Distribution
4441
dist

.gitmodules

-3
This file was deleted.

Makefile

+9-13
Original file line numberDiff line numberDiff line change
@@ -173,14 +173,17 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi
173173

174174
##@ Docs
175175

176+
.PHONY: generate-api-reference
177+
generate-api-reference: gen-crd-api-ref-docs ## Generate CRDS api-reference
178+
go run hack/genrefs/main.go
179+
176180
.PHONY: serve-docs
177-
serve-docs: hugo ## Run Hugo live preview.
178-
$(HUGO) serve docs -s docs
181+
serve-docs: ## Run live preview.
182+
docker run --rm -it -p 8000:8000 -v ${PWD}/docs:/docs squidfunk/mkdocs-material
179183

180184
.PHONY: generate-docs
181-
generate-docs: hugo gen-crd-api-ref-docs ## Generate the documentation website locally.
182-
go run hack/genrefs/main.go
183-
cd docs && $(HUGO) --minify -s .
185+
generate-docs: ## Generate the documentation website locally.
186+
docker run --rm -it -v ${PWD}/docs:/docs squidfunk/mkdocs-material build
184187

185188
##@ Build Dependencies
186189

@@ -195,15 +198,13 @@ KUSTOMIZE ?= $(LOCALBIN)/kustomize
195198
CONTROLLER_GEN ?= $(LOCALBIN)/controller-gen
196199
ENVTEST ?= $(LOCALBIN)/setup-envtest
197200
GINKGO=$(LOCALBIN)/ginkgo
198-
HUGO=$(LOCALBIN)/hugo
199201
GOLANGCILINT=$(LOCALBIN)/golangci-lint
200202
GEN_CRD_API_REF_DOCS=$(LOCALBIN)/gen-crd-api-reference-docs
201203

202204

203205
## Tool Versions
204206
KUSTOMIZE_VERSION ?= v4.2.0
205207
CONTROLLER_TOOLS_VERSION ?= v0.9.2
206-
HUGO_VERSION ?= v0.110.0
207208
GINKGO_VERSION ?= v2.3.1
208209

209210
KUSTOMIZE_INSTALL_SCRIPT ?= "https://raw.githubusercontent.com/kubernetes-sigs/kustomize/master/hack/install_kustomize.sh"
@@ -222,13 +223,8 @@ envtest: $(ENVTEST) ## Download envtest-setup locally if necessary.
222223
$(ENVTEST): $(LOCALBIN)
223224
test -s $(LOCALBIN)/setup-envtest || GOBIN=$(LOCALBIN) go install sigs.k8s.io/controller-runtime/tools/setup-envtest@latest
224225

225-
.PHONY: hugo
226-
hugo: $(HUGO) ## Download hugo locally if necessary.
227-
$(HUGO): $(LOCALBIN)
228-
test -s $(LOCALBIN)/hugo || GOBIN=$(LOCALBIN) go install --tags extended github.com/gohugoio/hugo@$(HUGO_VERSION)
229-
230226
.PHONY: gen-crd-api-ref-docs
231-
gen-crd-api-ref-docs: $(GEN_CRD_API_REF_DOCS) ## Download gen-crd-api-ref-docs hugo locally if necessary.
227+
gen-crd-api-ref-docs: $(GEN_CRD_API_REF_DOCS) ## Download gen-crd-api-ref-docs locally if necessary.
232228
$(GEN_CRD_API_REF_DOCS): $(LOCALBIN)
233229
test -s $(LOCALBIN)/gen-crd-api-reference-docs || GOBIN=$(LOCALBIN) go install github.com/ahmetb/gen-crd-api-reference-docs@latest
234230

docs/.hugo_build.lock

Whitespace-only changes.

docs/assets/icons/logo.svg

-99
This file was deleted.

docs/assets/scss/_variables_project.scss

-9
This file was deleted.

docs/config.toml

-60
This file was deleted.

docs/content/en/docs/api-reference/.gitkeep

Whitespace-only changes.

0 commit comments

Comments
 (0)