mirror of https://github.com/grafana/grafana
Chore: Migrate pr-docs pipeline to GHAs (#101982)
* baldmomma/ add pr-lint-build-docs.yml * baldm0mma/ update codeowners * baldm0mma/ remove superfluous command * baldm0mma/ trigger * baldm0mma/ update with heredoc format * baldm0mma/ update content stash * baldm0mma/ explore container for prod target * baldm0mma/ update to use hugo directly * baldm0mma/ clone the websote dir * baldm0mma/ rebuild with docker * baldm0mma/ docker run * baldm0mma/ remove build trigger * baldm0mma/ remove cue gen step that is covered elsewherepull/101767/head^2
parent
42958497ff
commit
a3ada25579
@ -0,0 +1,52 @@ |
||||
name: Documentation |
||||
|
||||
on: |
||||
pull_request: |
||||
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 |
Loading…
Reference in new issue