The open and composable observability and data visualization platform. Visualize metrics, logs, and traces from multiple sources like Prometheus, Loki, Elasticsearch, InfluxDB, Postgres and many more.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
grafana/.github/workflows/lint-build-docs.yml

60 lines
1.8 KiB

name: Documentation
on:
pull_request:
paths:
- '*.md'
- 'docs/**'
- 'packages/**/*.md'
- 'latest.json'
push:
branches:
- main
paths:
- '*.md'
- 'docs/**'
- 'packages/**/*.md'
- 'latest.json'
jobs:
docs:
name: Build & Verify Docs
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22.11.0'
cache: 'yarn'
- name: Install dependencies
run: yarn install --immutable
- name: Lint docs
run: yarn run prettier:checkDocs
env:
# Increase memory for prettier due to large number of files
NODE_OPTIONS: --max_old_space_size=8192
- name: Build docs website
run: |
# Create and start a container from the docs-base image in detached mode
docker run -d --name docs-builder grafana/docs-base:latest tail -f /dev/null
# Create the directory structure inside the container
docker exec docs-builder mkdir -p /hugo/content/docs/grafana/latest
# Create the _index.md file
docker exec docs-builder /bin/sh -c "echo -e '---\nredirectURL: /docs/grafana/latest/\ntype: redirect\nversioned: true\n---\n' > /hugo/content/docs/grafana/_index.md"
# Copy the docs sources from the host to the container
docker cp docs/sources/. docs-builder:/hugo/content/docs/grafana/latest/
# Run the make prod command inside the container
docker exec -w /hugo docs-builder make prod || echo "Build completed with warnings"
# Clean up the container
docker rm -f docs-builder