Skip to content

Commit

Permalink
ci(docs): replace hugo with mkdocs (#261)
Browse files Browse the repository at this point in the history
  • Loading branch information
byashimov authored Feb 13, 2023
1 parent 90c4011 commit 4d6adbb
Show file tree
Hide file tree
Showing 83 changed files with 1,098 additions and 3,419 deletions.
39 changes: 7 additions & 32 deletions .github/workflows/pages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,43 +11,18 @@ jobs:
runs-on: ubuntu-latest

steps:
- name: Fetch Hugo theme
- name: Checkout
uses: actions/checkout@v3
with:
submodules: recursive
fetch-depth: 0

- name: Setup Go
uses: actions/setup-go@v2
with:
go-version: '1.18'

- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.110.0'
extended: true

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: '18'

- name: Install npm deps
uses: actions/cache@v1
with:
path: ~/.npm
key: ${{ runner.os }}-node-${{ hashFiles('**/package-lock.json') }}
restore-keys: |
${{ runner.os }}-node-

- name: Generate docs
run: |
npm ci --prefix ./docs
make generate-docs
uses: addnab/docker-run-action@v3
with:
image: squidfunk/mkdocs-material:latest
options: -v ${{ github.workspace }}/docs/:/docs
run: mkdocs build

- name: Deploy
uses: peaceiris/actions-gh-pages@v3
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./docs/public
publish_dir: ./docs/site
5 changes: 1 addition & 4 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,7 @@ bundle-*
hack/tools/bin/*

# Docs
docs/node_modules
docs/public
docs/resources
docs/content/en/docs/api-reference/_index.md
docs/site

# Distribution
dist
3 changes: 0 additions & 3 deletions .gitmodules

This file was deleted.

22 changes: 9 additions & 13 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -173,14 +173,17 @@ undeploy: ## Undeploy controller from the K8s cluster specified in ~/.kube/confi

##@ Docs

.PHONY: generate-api-reference
generate-api-reference: gen-crd-api-ref-docs ## Generate CRDS api-reference
go run hack/genrefs/main.go

.PHONY: serve-docs
serve-docs: hugo ## Run Hugo live preview.
$(HUGO) serve docs -s docs
serve-docs: ## Run live preview.
docker run --rm -it -p 8000:8000 -v ${PWD}/docs:/docs squidfunk/mkdocs-material

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

##@ Build Dependencies

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


## Tool Versions
KUSTOMIZE_VERSION ?= v4.2.0
CONTROLLER_TOOLS_VERSION ?= v0.9.2
HUGO_VERSION ?= v0.110.0
GINKGO_VERSION ?= v2.3.1

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

.PHONY: hugo
hugo: $(HUGO) ## Download hugo locally if necessary.
$(HUGO): $(LOCALBIN)
test -s $(LOCALBIN)/hugo || GOBIN=$(LOCALBIN) go install --tags extended github.com/gohugoio/hugo@$(HUGO_VERSION)

.PHONY: gen-crd-api-ref-docs
gen-crd-api-ref-docs: $(GEN_CRD_API_REF_DOCS) ## Download gen-crd-api-ref-docs hugo locally if necessary.
gen-crd-api-ref-docs: $(GEN_CRD_API_REF_DOCS) ## Download gen-crd-api-ref-docs locally if necessary.
$(GEN_CRD_API_REF_DOCS): $(LOCALBIN)
test -s $(LOCALBIN)/gen-crd-api-reference-docs || GOBIN=$(LOCALBIN) go install github.com/ahmetb/gen-crd-api-reference-docs@latest

Expand Down
Empty file removed docs/.hugo_build.lock
Empty file.
99 changes: 0 additions & 99 deletions docs/assets/icons/logo.svg

This file was deleted.

9 changes: 0 additions & 9 deletions docs/assets/scss/_variables_project.scss

This file was deleted.

60 changes: 0 additions & 60 deletions docs/config.toml

This file was deleted.

Empty file.
Loading

0 comments on commit 4d6adbb

Please sign in to comment.