MKDocs Static Site Build
Build a MKDocs site from the config specified in mkdocs.yml
. Only runs if mkdocs.yml
exists in the repository root directory. This job is designated to run on all branchs so that you can use the artifacts for deployment to staging
and/or production
as required.
This job provides the following badge:
- None
Dependencies
- Mandatory file
mkdocs.yml
in the repository root directory with your MKDocs configuration
your .gitlab-ci.yml changes
To use this job add the following to your .gitlab-ci.yml
file
stages:
- build
include:
- local: CI/build/.gitlab-ci.yml
MKDocs build:
variables:
MKDOCS_BUILD_PATH: "build"
extends:
- .MKDocs_Build
CI/CD Variables required
var name | Description |
---|---|
MKDOCS_BUILD_PATH | Mandatory, if different from default The path where MKDocs places the build files. Defaults to build |
MKDOCS_INCLUDE_SOURCE | Optional Include the build source files in the artifacts. Default is Not set. Any value in this variable, will include the source files. |
MKDOCS_SOURCE_PATH | Optional, if source files are not to be included Set to the path where mkdocs uses to build the static html. |
Job Workflow
-
install mkdocs
-
if file
requirements.txt
exists in the repository root directory, use this fill to also install additional dependencies. -
if no
requirements.txt
file exists, only install mkdocs.
-
-
run mkdocs to build the static pages
-
if variable
$MKDOCS_INCLUDE_SOURCE
is set, then copy$MKDOCS_SOURCE_PATH
to the artifacts location. -
copy directory
$MKDOCS_BUILD_PATH
to the artifacts location.
Artifacts
- files in
"$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
Gitlab job Definition
When you include this definition the following makes up the job definition
.gitlab-ci.yml | |
---|---|
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 |
|
Note
Docs Still under development
About:
This page forms part of our Project Gitlab-CI.
Page Metadata
Version: ToDo: place files short git commit hereDate Created: 2021-08-11
Date Edited: 2023-05-23
Contribution:
Would You like to contribute to our Gitlab-CI project? You can assist in the following ways:
- Edit This Page If there is a mistake or a way you can improve it.
- Add a Page to the Manual if you would like to add an item to our manual
- Raise an Issue if there is something about this page you would like to improve, and git is unfamiliar to you.
ToDo: Add the page list of contributors