2
0
mirror of https://github.com/linka-cloud/d2vm.git synced 2025-06-23 22:02:25 +00:00

setup documentation site build and deploy

This commit is contained in:
2022-05-19 15:41:06 +02:00
parent 6d8a8d80f5
commit 7c12ca465a
15 changed files with 75 additions and 1 deletions

View File

@ -111,3 +111,26 @@ examples: build-dev
cli-docs: .build
@rm -rf $(CLI_REFERENCE_PATH)
@./d2vm docs $(CLI_REFERENCE_PATH)
serve-docs:
@docker run --rm -i -t --user=$(UID) -p 8000:8000 -v $(PWD):/docs linkacloud/mkdocs-material serve -f /docs/docs/mkdocs.yml -a 0.0.0.0:8000
.PHONY: build-docs
build-docs: clean-docs cli-docs
@docker run --rm -v $(PWD):/docs linkacloud/mkdocs-material build -f /docs/docs/mkdocs.yml -d build
GIT_BRANCH := $(shell git rev-parse --abbrev-ref HEAD)
GITHUB_PAGES_BRANCH := gh-pages
deploy-docs:
@git branch -D gh-pages &> /dev/null || true
@git checkout -b $(GITHUB_PAGES_BRANCH)
@rm .gitignore && mv docs docs-src && mv docs-src/build docs && rm -rf docs-src
@git add . && git commit -m "build docs" && git push origin --force $(GITHUB_PAGES_BRANCH)
@git checkout $(GIT_BRANCH)
docs: cli-docs build-docs deploy-docs
clean-docs:
@rm -rf docs/build