team-docs/.gitlab-ci.yml
2023-06-24 21:13:25 +02:00

51 lines
1.5 KiB
YAML

build:
stage: build
image:
name: antora/antora:latest
script:
- antora --log-failure-level fatal site.yml
artifacts:
paths:
- public/
expire_in: 1 week
expose_as: 'docs preview'
rules:
- if: $CI_PIPELINE_SOURCE == 'merge_request_event'
environment:
name: preview MR_${CI_MERGE_REQUEST_IID}
url: https://${CI_SERVER_HOST}/${CI_PROJECT_PATH}/-/jobs/${CI_JOB_ID}/artifacts/file/public/index.html
auto_stop_in: 1 week
pages:
stage: build
image:
name: antora/antora:latest
script:
- antora site.yml
artifacts:
paths:
- public
rules:
- if: $CI_COMMIT_BRANCH == "main" && $CI_PROJECT_ROOT_NAMESPACE == "fedora"
code_quality:
image:
name: jdkato/vale:latest
entrypoint: [""]
tags: [shared]
variables:
VARH_REPO: "redhat-documentation/vale-at-red-hat"
VARH_BRANCH: "main"
before_script:
# - apk update && apk add git
- vale sync
script:
# list of updated/modified *.adoc files
# - FILES=$(git diff --name-only HEAD~1 HEAD --diff-filter=d "*.adoc")
# clean out conditions for wider vale coverage
# - sed -i -e 's/ifdef::.*\|ifndef::.*\|ifeval::.*\|endif::.*/ /' ${FILES}
# use a template to rearrange the vale JSON output
# run vale with `--no-exit` to pass the build with errors
- vale --no-exit --minAlertLevel=error --glob='*.adoc' --output="$(pwd)/vale-json.tmpl" . | sed "s/CI_COMMIT_SHA/$CI_COMMIT_SHA/g" > gl-code-quality-report.json
artifacts:
reports:
codequality: gl-code-quality-report.json