From 1c60d5190501e3a9c35377160c202b0b1647e13f Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Fri, 29 Nov 2024 10:19:06 +0100 Subject: [PATCH] add deploy preview workflow (#97140) * add deploy preview workflow * remove unnecessary file to trigger build * fix repo * change ref * change ref * update docs * update codeowners * Update docs/README.md Co-authored-by: Jack Baldry --------- Co-authored-by: Jack Baldry --- .github/CODEOWNERS | 1 + .github/workflows/deploy-pr-preview.yml | 22 ++++++++++++++++++++++ docs/README.md | 5 +++++ docs/sources/menu.yaml | 0 4 files changed, 28 insertions(+) create mode 100644 .github/workflows/deploy-pr-preview.yml delete mode 100644 docs/sources/menu.yaml diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS index dcb7fb87c6d..e34bca5a228 100644 --- a/.github/CODEOWNERS +++ b/.github/CODEOWNERS @@ -714,6 +714,7 @@ embed.go @grafana/grafana-as-code /.github/workflows/community-release.yml @grafana/grafana-developer-enablement-squad /.github/workflows/detect-breaking-changes-* @grafana/plugins-platform-frontend /.github/workflows/doc-validator.yml @grafana/docs-tooling +/.github/workflows/deploy-pr-preview.yml @grafana/docs-tooling /.github/workflows/epic-add-to-platform-ux-parent-project.yml @meanmina /.github/workflows/github-release.yml @grafana/grafana-developer-enablement-squad /.github/workflows/issue-labeled.yml @armandgrillet diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml new file mode 100644 index 00000000000..4c51a57b229 --- /dev/null +++ b/.github/workflows/deploy-pr-preview.yml @@ -0,0 +1,22 @@ +name: Deploy pr preview + +on: + pull_request: + types: + - opened + - synchronize + - closed + paths: + - "docs/sources/**" + +jobs: + deploy-pr-preview: + uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@main + with: + sha: ${{ github.event.pull_request.head.sha }} + branch: ${{ github.head_ref }} + event_number: ${{ github.event.number }} + title: ${{ github.event.pull_request.title }} + repo: grafana + website_directory: content/docs/grafana/latest + relative_prefix: /docs/grafana/latest/ \ No newline at end of file diff --git a/docs/README.md b/docs/README.md index 2831e537237..4bea7d788e7 100644 --- a/docs/README.md +++ b/docs/README.md @@ -19,6 +19,11 @@ First, make sure the Docker daemon is running on your machine. Then, follow thes If you have the grafana/website repo checked out in the same directory as the grafana repo, then you can run `make docs-local-static` to use local assets (such as images). +## Deploy preview + +When you open a PR that changes files in the `docs/sources/` directory, CI builds a deploy preview. +After the deploy preview has been built, the **Deploy pr preview** workflow comments a link to the preview URL and adds a commit status check . + --- ## Content guidelines diff --git a/docs/sources/menu.yaml b/docs/sources/menu.yaml deleted file mode 100644 index e69de29bb2d..00000000000