Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
59 commits
Select commit Hold shift + click to select a range
b33b6f4
update deploy preview workflow with broken link check
robbymilo Mar 13, 2026
5e587ff
trigger workflow
robbymilo Mar 13, 2026
d4c89eb
trigger workflow
robbymilo Mar 13, 2026
8309db9
Merge remote-tracking branch 'origin/main' into robbymilo/deploy-preview
robbymilo Mar 13, 2026
ca3b575
trigger workflow
robbymilo Mar 13, 2026
c67d4b4
trigger workflow
robbymilo Mar 13, 2026
9a94046
fix ref, dist location
robbymilo Mar 13, 2026
e4c3052
log requests
robbymilo Mar 13, 2026
205006e
fix logs
robbymilo Mar 13, 2026
ca1b5d5
update include
robbymilo Mar 13, 2026
fbeb1dd
proxy everything but relative_prefix
robbymilo Mar 13, 2026
b0fa1be
only crawl pages under relative_prefix
robbymilo Mar 13, 2026
70b2a71
try collecting pages
robbymilo Mar 13, 2026
88ee76a
try muffet again
robbymilo Mar 13, 2026
31c476b
remove muffet
robbymilo Mar 13, 2026
cf7dae9
change regex
robbymilo Mar 13, 2026
7c0fd17
don't check external domains
robbymilo Mar 13, 2026
ccfc3d7
ignore launch, fix comment
robbymilo Mar 13, 2026
1dd7366
ignore web
robbymilo Mar 13, 2026
4cba452
also exclude grafana.com in regex
robbymilo Mar 13, 2026
8437956
dont check links in certain HTML elements
robbymilo Mar 13, 2026
68d5d80
update comment with broken links from changed files
robbymilo Mar 17, 2026
f1fdf71
try moving file
robbymilo Mar 18, 2026
cd12a9d
Remove alias
robbymilo Mar 18, 2026
044ffcf
improve
robbymilo Mar 18, 2026
6e96c25
use envs
robbymilo Mar 18, 2026
329b6ad
add comments, clean up
robbymilo Mar 25, 2026
669f42d
use separate nginx conf for deploy preview, use shared locations
robbymilo Mar 25, 2026
7e9a477
Merge remote-tracking branch 'origin/main' into robbymilo/deploy-preview
robbymilo Mar 25, 2026
c7f2471
ignore unstyled from comment
robbymilo Mar 26, 2026
4d76694
move gh logic to go, add line/column support
robbymilo Mar 26, 2026
4adf0c1
Merge remote-tracking branch 'origin/main' into robbymilo/deploy-preview
robbymilo Mar 26, 2026
ffc060f
checkout docs/sources udring check-links job
robbymilo Mar 26, 2026
f332f07
move out of scripts
robbymilo Mar 26, 2026
bb5003a
fix workflow for other repos
robbymilo Mar 26, 2026
0e3d5ac
fix other jobs
robbymilo Mar 26, 2026
97637b2
normalize paths
robbymilo Mar 26, 2026
0fce8c4
fix source files
robbymilo Mar 26, 2026
af83bdb
remove prefix
robbymilo Mar 26, 2026
af1bb3a
fix ci
robbymilo Mar 26, 2026
b97f0d6
remove prefix from link column
robbymilo Mar 26, 2026
d29c355
add routes
robbymilo Mar 26, 2026
2e5ccdd
fix lint errors
robbymilo Mar 26, 2026
b265313
add routes
robbymilo Mar 26, 2026
c10664e
add redirects, fix false positives
robbymilo Mar 26, 2026
4f123ec
add routes
robbymilo Mar 26, 2026
0a427bb
only check content
robbymilo Mar 26, 2026
1089065
add links to comment, add location
robbymilo Mar 30, 2026
8914c2a
remove link from column
robbymilo Mar 30, 2026
961c4a2
use docker image
robbymilo Mar 31, 2026
30b5f8a
run as root
robbymilo Mar 31, 2026
95ab516
remove files
robbymilo Mar 31, 2026
69165b0
Merge branch 'main' into robbymilo/deploy-preview
robbymilo Apr 1, 2026
63ba3e4
Merge branch 'main' into robbymilo/deploy-preview
robbymilo Apr 3, 2026
2c21467
update image
robbymilo Apr 8, 2026
8aba747
fix image
robbymilo Apr 8, 2026
8a831e5
update workflow
robbymilo Apr 9, 2026
a9c3f89
Merge branch 'main' into robbymilo/deploy-preview
robbymilo Apr 9, 2026
cfb8c77
add target handling
robbymilo Apr 15, 2026
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 31 additions & 0 deletions .github/workflows/broken-link-ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
name: Run Continuous Integration (link-checker)
on:
pull_request:
paths: 'link-checker/**'

jobs:
go-test:
permissions:
contents: read
# Allow write access to checks to allow the golangci-lint action to annotate code in the PR.
checks: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@34e114876b0b11c390a56381ad16ebd13914f8d5 # v4.3.1
with:
persist-credentials: false
sparse-checkout: |
link-checker
- uses: actions/setup-go@40f1582b2485089dde7abd97c1529aa768e1baff # v5.6.0
with:
go-version-file: link-checker/go.mod
- uses: golangci/golangci-lint-action@1e7e51e771db61008b38414a730f564565cf7c20 # v9
with:
working-directory: link-checker
- run: go test ./...
working-directory: link-checker
- run: go build ./cmd/link-checker
working-directory: link-checker
- run: docker build --tag writers-toolkit-link-checker:test .
working-directory: link-checker
- run: docker run --rm writers-toolkit-link-checker:test help
2 changes: 1 addition & 1 deletion .github/workflows/deploy-pr-preview.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ on:

jobs:
deploy-pr-preview:
uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@main
uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@robbymilo/deploy-preview # zizmor: ignore[unpinned-uses] It's a protected branch in the same repository.
if: "!github.event.pull_request.head.repo.fork"
permissions:
contents: read # Clone repository.
Expand Down
434 changes: 351 additions & 83 deletions .github/workflows/deploy-preview.yml

Large diffs are not rendered by default.

9 changes: 9 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,3 +8,12 @@ build.conf
/dist
/vale/Grafana.zip
vale/tools/inhibit-rules
access.log
.gitignore
changed-files.txt
error.log
links.json
broken-links-comment.md
nginx.conf
run/nginx.pid
docs/dist
4 changes: 3 additions & 1 deletion deploy-preview/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@ RUN rm -rf /etc/nginx/sites-enabled && \
rm -rf /etc/nginx/nginx.conf

COPY deploy-preview-files/deploy-preview/nginx.conf /etc/nginx/nginx.conf
COPY deploy-preview-files/deploy-preview/locations.conf /etc/nginx/locations.conf
COPY deploy-preview-files/deploy-preview/redirects.conf /etc/nginx/redirects.conf
COPY build.conf /etc/nginx/build.conf

RUN nginx -t
RUN nginx -t
4 changes: 3 additions & 1 deletion deploy-preview/build
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ if [[ -n "${WEBSITE_DIRECTORY}" ]]; then
readonly SOURCE_DIRECTORY="${SOURCE_DIRECTORY:-}"
readonly REPO="${REPO:-}"
readonly INDEX_FILE="${INDEX_FILE:-false}"
readonly RELATIVE_PREFIX="${RELATIVE_PREFIX:-/docs/${REPO}/latest/}"

docker run \
-v "${PWD}/dist:/hugo/dist" \
-v "${PWD}/${SOURCE_DIRECTORY}:/hugo/${WEBSITE_DIRECTORY}" \
-e INDEX_FILE \
-e REPO \
-e WEBSITE_DIRECTORY \
-e RELATIVE_PREFIX \
--rm "${IMAGE:-grafana/docs-base:latest}" \
/bin/bash \
-c '
Expand All @@ -29,7 +31,7 @@ if [[ "${INDEX_FILE}" == "true" ]]; then
cat > "/hugo/content/docs/${REPO}/_index.md" <<EOF
---
type: redirect
redirectURL: /docs/${REPO}/latest/
redirectURL: ${RELATIVE_PREFIX}
versioned: true
---
EOF
Expand Down
26 changes: 26 additions & 0 deletions deploy-preview/docs-target
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
#!/usr/bin/env bash
# Determine the documentation target directory from a Git base ref.
# Mirrors the logic from https://github.com/grafana/grafana-github-actions/tree/main/docs-target
#
# Usage: docs-target <base_ref>
#
# For main/master branches, the target is "next".
# For release branches, the target is "latest".

set -euf -o pipefail

readonly BASE_REF="${1:-}"

if [[ -z "${BASE_REF}" ]]; then
echo "Usage: docs-target <base_ref>" >&2
exit 1
fi

case "${BASE_REF}" in
main|master)
echo "next"
;;
*)
echo "latest"
;;
esac
34 changes: 34 additions & 0 deletions deploy-preview/locations.conf
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
location /static {
proxy_pass https://grafana.com/static;
}

location /media {
proxy_pass https://grafana.com/media;
}

location /api {
proxy_pass https://grafana.com/api;
}

location ~ ^/(web|grafana|help|community|blog|products|oss|events|tutorials|whats-new|contact|login|auth|developers|profile|orgs|legal|tutorials|signup|pricing|enterprise|accessibility|assets|about|go|careers|press|support|security)(/.*)?$ {
proxy_pass https://grafana.com;
}

location ~ ^/connect(.*)$ {

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;

proxy_ssl_server_name on;
resolver 8.8.8.8 8.8.4.4 ipv6=off;
resolver_timeout 5s;
set $faro "faro-collector-prod-us-central-0.grafana.net";

proxy_pass https://$faro/collect$1;
}

location /healthz {
return 200 'ok';
add_header Content-Type text/plain;
}
35 changes: 3 additions & 32 deletions deploy-preview/nginx.conf
Original file line number Diff line number Diff line change
Expand Up @@ -70,36 +70,7 @@ http {
alias /usr/share/nginx/dist/;
}

location /static {
proxy_pass https://grafana.com/static;
}

location /media {
proxy_pass https://grafana.com/media;
}

location /api {
proxy_pass https://grafana.com/api;
}

location ~ ^/connect(.*)$ {

proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
proxy_set_header Host $http_host;
proxy_set_header X-Forwarded-Proto $http_x_forwarded_proto;

proxy_ssl_server_name on;
resolver 8.8.8.8 8.8.4.4 ipv6=off;
resolver_timeout 5s;
set $faro "faro-collector-prod-us-central-0.grafana.net";

proxy_pass https://$faro/collect$1;
}


location /healthz {
return 200 'ok';
add_header Content-Type text/plain;
}
include /etc/nginx/locations.conf;
include /etc/nginx/redirects.conf;
}
}
}
Loading
Loading