diff --git a/.github/workflows/docs.yaml b/.github/workflows/docs.yaml new file mode 100644 index 0000000..84af836 --- /dev/null +++ b/.github/workflows/docs.yaml @@ -0,0 +1,22 @@ +name: Docs +on: + push: + branches: + - docs + - main +jobs: + deploy: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v1 + - name: Build and deploy mkdocs site + run: | + git config --global user.name "github-actions[bot]" + git config --global user.email "41898282+github-actions[bot]@users.noreply.github.com" + make build-docs + sudo chown -R ${UID}:${UID} docs + make deploy-docs + diff --git a/.gitignore b/.gitignore index 16cde8b..4679f56 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,8 @@ scratch bin/ dist/ images -wstation /d2vm /examples/build +.goreleaser.yaml +docs/build +docs-src diff --git a/Makefile b/Makefile index 6ce2eb8..6395c96 100644 --- a/Makefile +++ b/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 diff --git a/docs/.DS_Store b/docs/.DS_Store new file mode 100644 index 0000000..4537f00 Binary files /dev/null and b/docs/.DS_Store differ diff --git a/docs/content/assets/d2vm-dark-b.png b/docs/content/assets/d2vm-dark-b.png new file mode 100644 index 0000000..abd8ea6 Binary files /dev/null and b/docs/content/assets/d2vm-dark-b.png differ diff --git a/docs/content/assets/d2vm-dark-tr.png b/docs/content/assets/d2vm-dark-tr.png new file mode 100644 index 0000000..fd2e630 Binary files /dev/null and b/docs/content/assets/d2vm-dark-tr.png differ diff --git a/docs/content/assets/d2vm-dark.png b/docs/content/assets/d2vm-dark.png new file mode 100644 index 0000000..e142f1d Binary files /dev/null and b/docs/content/assets/d2vm-dark.png differ diff --git a/docs/content/assets/d2vm-favicon.png b/docs/content/assets/d2vm-favicon.png new file mode 100644 index 0000000..a46e7d9 Binary files /dev/null and b/docs/content/assets/d2vm-favicon.png differ diff --git a/docs/content/assets/d2vm-light-tr.png b/docs/content/assets/d2vm-light-tr.png new file mode 100644 index 0000000..864bdf0 Binary files /dev/null and b/docs/content/assets/d2vm-light-tr.png differ diff --git a/docs/content/assets/d2vm-light.png b/docs/content/assets/d2vm-light.png new file mode 100644 index 0000000..60343a2 Binary files /dev/null and b/docs/content/assets/d2vm-light.png differ diff --git a/docs/content/assets/d2vm.png b/docs/content/assets/d2vm.png new file mode 100644 index 0000000..52e3ccc Binary files /dev/null and b/docs/content/assets/d2vm.png differ diff --git a/docs/content/assets/matrixorg-icon.svg b/docs/content/assets/matrixorg-icon.svg new file mode 100644 index 0000000..788ce50 --- /dev/null +++ b/docs/content/assets/matrixorg-icon.svg @@ -0,0 +1 @@ + \ No newline at end of file diff --git a/docs/content/full-example.md b/docs/content/full-example.md new file mode 120000 index 0000000..ffd15a0 --- /dev/null +++ b/docs/content/full-example.md @@ -0,0 +1 @@ +../../examples/full/README.md \ No newline at end of file diff --git a/docs/content/index.md b/docs/content/index.md new file mode 120000 index 0000000..fe84005 --- /dev/null +++ b/docs/content/index.md @@ -0,0 +1 @@ +../../README.md \ No newline at end of file diff --git a/docs/mkdocs.yml b/docs/mkdocs.yml new file mode 100755 index 0000000..6051670 --- /dev/null +++ b/docs/mkdocs.yml @@ -0,0 +1,24 @@ +site_name: "" +docs_dir: content +site_dir: build +theme: + name: linka-cloud + logo: assets/d2vm-light-tr.png + favicon: assets/d2vm-favicon.png + language: en +repo_url: https://github.com/linka-cloud/d2vm +copyright: Copyright © 2022 Linka Cloud +extra: + homepage: https://github.com/linka-cloud/d2vm + social: + - icon: fontawesome/brands/github + link: https://github.com/linka-cloud + - icon: fontawesome/brands/docker + link: https://hub.docker.com/r/linkacloud + +markdown_extensions: + - pymdownx.highlight: + use_pygments: true + - pymdownx.superfences + - pymdownx.tasklist +