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:
23
Makefile
23
Makefile
@ -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
|
||||
|
Reference in New Issue
Block a user