Commit b4c03fdb authored by Valentin Guyon's avatar Valentin Guyon Committed by Thibaud-Vdb
Browse files

feat(job): create docusaurus_build job

parent 9ee6d492
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -405,5 +405,8 @@ YamlLint
Yamllint
yamllint
zaproxy
Docusaurus
MDX
mdBook
webpack
Webpack
+32 −0
Original line number Diff line number Diff line
## Objective

Build HTML documentation form Markdown source using Docusaurus, and can even embed JSX components into your Markdown thanks to MDX.
In order to build Docusaurus, the user must `init` a Docusaurus project, checkout the [documentation](https://docusaurus.io/docs/installation){:target="_blank"}. 

## How to use it

1. Ensure that your project has [`package.json`](https://docs.npmjs.com/cli/v6/configuring-npm/package-json){:target="_blank"}
      file.
1. Check the Docusaurus [documentation](https://docusaurus.io/docs){:target="_blank"} to install and configure a Docusaurus project.
1. Add this job URL inside the `include` list of your `.gitlab-ci.yml` file (see the [quick setup](/use-the-hub/#quick-setup)). You can specify [a fixed version](#changelog) instead of `latest`.
    ```yaml
      - remote: 'https://jobs.r2devops.io/latest/docusaurus_build.yml'
    ```
1. If you need to customize the job (stage, variables, ...) 👉 check the [jobs
   customization](/use-the-hub/#jobs-customization)
1. Well done, your job is ready to work ! 😀

## Job details

* Job name: `docusaurus_build`
* Docker image:
[`node:16.13.1-buster`](https://hub.docker.com/r/_/node)
* Default stage: `build`
* When: `always`

### Variables

| Name | Description | Default |
| ---- | ----------- | ------- |
| `PROJECT_ROOT` <img width=100/> | Relative path in your repository to your Docusaurus project. <img width=175/>| `.` <img width=100/>|
| `DOCUSAURUS_OUTPUT_PATH` <img width=100/> | Directory who contains the result of the Docusaurus build. <img width=175/>| `website_build` <img width=100/>|
+27 −0
Original line number Diff line number Diff line
# Job from R2Devops hub --> r2devops.io

stages:
  - build

docusaurus_build:

  image:
    name: node:16.13.1-buster
    entrypoint: [""]

  stage: build

  variables:
    PROJECT_ROOT: "."
    DOCUSAURUS_OUTPUT_PATH: "website_build/"

  script:
    - cd ${PROJECT_ROOT}
    - npm install
    - npm install docusaurus
    - npx docusaurus build --out-dir ${CI_PROJECT_DIR}/${DOCUSAURUS_OUTPUT_PATH}

  artifacts:
    when: always
    paths:
      - ${CI_PROJECT_DIR}/${DOCUSAURUS_OUTPUT_PATH}
+14 −0
Original line number Diff line number Diff line
name: docusaurus_build
description: Build HTML documentation from Markdown source using Docusaurus, and can even embed JSX components into your Markdown thanks to MDX.
default_stage: build
icon: 🧱
maintainer: valentin.guyon.vg
license: Apache-2.0
images:
  "node": "16.13.1-buster"
tools:
labels:
  - GitLab
  - NPM
  - Build
  - Docusaurus
+0 −0

Empty file added.

Loading