-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: generate a website with mkdocs
- Loading branch information
1 parent
35fce56
commit ee43f7d
Showing
12 changed files
with
150 additions
and
32 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,45 @@ | ||
--- | ||
name: Build and publish documentation site | ||
|
||
on: # yamllint disable-line rule:truthy | ||
push: | ||
paths: | ||
- ".github/workflows/documentation.yaml" | ||
- "docs/**" | ||
- "config/mkdocs/home-lab-docs/**" | ||
- scripts/run-mkdocs.sh | ||
pull_request: | ||
paths: | ||
- ".github/workflows/documentation.yaml" | ||
- "docs/**" | ||
- "config/mkdocs/home-lab-docs/**" | ||
- scripts/run-mkdocs.sh | ||
workflow_call: null | ||
|
||
permissions: | ||
contents: read | ||
|
||
jobs: | ||
build-documentation-site: | ||
concurrency: | ||
# Ref: https://docs.github.com/en/actions/learn-github-actions/contexts#github-context | ||
# github.head_ref: head_ref or source branch of the pull request | ||
# github.ref: ref of the branch that triggered the workflow | ||
group: ${{ github.workflow }}-build-documentation-sites-${{ github.head_ref || github.ref }}-${{ github.event_name }} | ||
cancel-in-progress: true | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
- name: Build the documentation site | ||
run: | | ||
scripts/run-mkdocs.sh "build" | ||
- name: Commit and push updates to the documentation site | ||
if: > | ||
github.event_name == 'pull_request' && | ||
github.ref_name != github.event.repository.default_branch | ||
uses: stefanzweifel/git-auto-commit-action@v5.0.1 | ||
with: | ||
branch: ${{ github.event.pull_request.head.ref || github.head_ref || github.ref }} | ||
commit_message: "chore: update documentation site" | ||
commit_user_name: github-actions[bot] | ||
commit_user_email: 41898282+github-actions[bot]@users.noreply.g |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,5 @@ | ||
# ferrarimarco's Home Lab | ||
# My Home Lab | ||
|
||
All the necessary to provision, configure and manage my home lab. | ||
|
||
Before using the home lab, you initialize the environments by executing | ||
a manual process. After the initalization process completes, | ||
automated processes take care of applying provisioning and | ||
configuration changes to the environments. | ||
|
||
## Get started | ||
|
||
For more information about how to set up the lab, see: | ||
|
||
- [Initialize the home lab on physical hardware](./docs/installation/production/README.md). | ||
|
||
## Architecture | ||
|
||
For more information about the architecture of the lab, see | ||
[Architecture](./docs/architecture/README.md). | ||
For more information about how to set up the lab, see | ||
[the webesite](https://ferrarimarco.github.io/home-lab) | ||
or the contents of the [docs directory](./docs/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
--- | ||
# yaml-language-server: $schema=https://squidfunk.github.io/mkdocs-material/schema.json | ||
docs_dir: "../../../docs" | ||
repo_url: https://github.com/ferrarimarco/home-lab | ||
site_dir: "../../../site" | ||
site_name: Home Lab docs | ||
site_url: https://ferrarimarco.github.io/home-lab | ||
strict: true | ||
theme: | ||
name: material | ||
features: | ||
- navigation.top | ||
- navigation.tracking |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
# Home lab | ||
|
||
All the necessary to provision, configure and manage my home lab. | ||
|
||
Before using the home lab, you initialize the environments by executing | ||
a manual process. After the initalization process completes, | ||
automated processes take care of applying provisioning and | ||
configuration changes to the environments. | ||
|
||
## Get started | ||
|
||
For more information about how to set up the lab, see: | ||
|
||
- [Initialize the home lab on physical hardware](./installation/production/README.md). | ||
|
||
## Architecture | ||
|
||
For more information about the architecture of the lab, see | ||
[Architecture](./architecture/README.md). |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,58 @@ | ||
#!/usr/bin/env bash | ||
|
||
# shellcheck source=/dev/null | ||
. "./scripts/common.sh" | ||
|
||
# renovate: datasource=docker packageName=squidfunk/mkdocs-material versioning=docker | ||
MKDOCS_CONTAINER_IMAGE_VERSION="9.5.41" | ||
MKDOCS_CONTAINER_IMAGE="squidfunk/mkdocs-material:${MKDOCS_CONTAINER_IMAGE_VERSION}" | ||
|
||
echo "Running mkdocs: ${MKDOCS_CONTAINER_IMAGE}" | ||
|
||
SUBCOMMAND="${1}" | ||
echo "Subcommand: ${SUBCOMMAND}" | ||
|
||
RUN_CONTAINER_COMMAND=( | ||
docker run | ||
--rm | ||
) | ||
|
||
if [ -t 0 ]; then | ||
RUN_CONTAINER_COMMAND+=( | ||
--interactive | ||
--tty | ||
) | ||
fi | ||
|
||
RUN_CONTAINER_COMMAND+=( | ||
--name "mkdocs" | ||
--publish "8000:8000" | ||
--volume "$(pwd)":/docs | ||
--volume /etc/localtime:/etc/localtime:ro | ||
"${MKDOCS_CONTAINER_IMAGE}" | ||
) | ||
|
||
DEFAULT_MKDOCS_ARGS=( | ||
--config-file config/mkdocs/home-lab-docs/mkdocs.yaml | ||
) | ||
|
||
if [[ "${1}" == "serve" ]]; then | ||
RUN_CONTAINER_COMMAND+=( | ||
"serve" | ||
"--dev-addr=0.0.0.0:8000" | ||
"${DEFAULT_MKDOCS_ARGS[@]}" | ||
) | ||
elif [[ "${1}" == "build" ]]; then | ||
RUN_CONTAINER_COMMAND+=( | ||
"build" | ||
"${DEFAULT_MKDOCS_ARGS[@]}" | ||
) | ||
elif [[ "${1}" == "create" ]]; then | ||
RUN_CONTAINER_COMMAND+=( | ||
"new" | ||
. | ||
) | ||
fi | ||
|
||
echo "Run container command: ${RUN_CONTAINER_COMMAND[*]}" | ||
"${RUN_CONTAINER_COMMAND[@]}" |