chore: initial add of build and validation jobs for mkdocs and markdown linting

copied from nofusscomputing/infrastructure/website/3dd3130a037b4ee7c3b55d3961e68703c5e5d49c

MR !15 #12 #15
This commit is contained in:
2022-01-23 09:43:00 +09:30
parent 1ef6c41818
commit bc67e939fa
2 changed files with 48 additions and 0 deletions

20
build/.gitlab-ci.yml Normal file
View File

@ -0,0 +1,20 @@
Static Pages:
image: python:3.7.5-buster
stage: build
variables:
GIT_DEPTH: 0
before_script:
- pip install --upgrade pip -r requirements.txt
script:
# - mkdir static
# - cp README.md pages/
- mkdocs build --clean --strict
- rm build/sitemap*
artifacts:
paths:
- build
rules:
- if: '$CI_COMMIT_BRANCH'
when: always
- when: never

28
validation/.gitlab-ci.yml Normal file
View File

@ -0,0 +1,28 @@
markdown lint:
image: node:alpine3.14
stage: validation
before_script:
- npm install markdownlint-cli2 --global
- npm install markdownlint-cli2-formatter-junit --global
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/$CI_JOB_NAME"
- mkdir -p "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests"
script:
- markdownlint-cli2 "**/*.md" "!gitlab-ci" 1>&1 || EXITCODE=$?
- echo DEBUG EXITCODE[$EXITCODE]
- mv markdown.junit.xml $CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/markdown.junit.xml
artifacts:
expire_in: 3 days
when: always
paths:
- "$CI_PROJECT_DIR/artifacts/*"
reports:
junit:
- "$CI_PROJECT_DIR/artifacts/$CI_JOB_STAGE/tests/*.junit.xml"
rules:
- if: '$CI_COMMIT_BRANCH == "master"'
when: never
- if: '$CI_COMMIT_BRANCH'
exists:
- "**.md"
- when: never