From b0530ea3df2d2a33d20096ade694cb051e95ad97 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Tue, 18 Jun 2024 07:47:39 +0300 Subject: [PATCH 1/6] Try adding preview URLs for docs --- .github/workflows/deploy-docs.yaml | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index e5c55e8c0..4be645d3d 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -81,3 +81,14 @@ jobs: with: name: docs path: docs/_build/html + + - name: Post preview link on PR + if: github.event_name == 'pull_request' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER=$(echo ${{ github.event.pull_request.number }}) + PREVIEW_URL="https://storage.googleapis.com/robusta-preview/${GITHUB_HEAD_REF}/index.html" + curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -d "{\"body\": \"🔍 [Preview Docs](${PREVIEW_URL})\"}" \ + "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" From 5da32c0dd89712ed1a11b0de3207c27a5ed14e59 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Tue, 18 Jun 2024 07:48:05 +0300 Subject: [PATCH 2/6] trigger docs build --- docs/index.rst | 1 + 1 file changed, 1 insertion(+) diff --git a/docs/index.rst b/docs/index.rst index 0ae72b44f..dc873dbb2 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -61,6 +61,7 @@ help + Welcome to the Robusta Docs =============================== From e6453ef693bea1342a7a0fadad62ae62b9282952 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Tue, 18 Jun 2024 08:19:06 +0300 Subject: [PATCH 3/6] Update deploy-docs.yaml --- .github/workflows/deploy-docs.yaml | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 4be645d3d..2b5ef8ae3 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -8,6 +8,10 @@ on: paths: - 'docs/**' - .github/workflows/deploy-docs.yaml + pull_request: + paths: + - 'docs/**' + jobs: has-secrets: From 30e91f1fbb82291800482f048887ef9c1249b39b Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Tue, 18 Jun 2024 08:25:29 +0300 Subject: [PATCH 4/6] Fix url --- .github/workflows/deploy-docs.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 2b5ef8ae3..9b78d1cc5 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -92,7 +92,7 @@ jobs: GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} run: | PR_NUMBER=$(echo ${{ github.event.pull_request.number }}) - PREVIEW_URL="https://storage.googleapis.com/robusta-preview/${GITHUB_HEAD_REF}/index.html" + PREVIEW_URL="https://docs.robusta.dev/${GITHUB_HEAD_REF}" curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ -d "{\"body\": \"🔍 [Preview Docs](${PREVIEW_URL})\"}" \ "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" From 585bbfcab8ecf6ff6826813bfa893d522b09e2cc Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Tue, 18 Jun 2024 08:56:25 +0300 Subject: [PATCH 5/6] Update deploy-docs.yaml --- .github/workflows/deploy-docs.yaml | 26 +++++++++++++++----------- 1 file changed, 15 insertions(+), 11 deletions(-) diff --git a/.github/workflows/deploy-docs.yaml b/.github/workflows/deploy-docs.yaml index 9b78d1cc5..d0f4e8c1c 100644 --- a/.github/workflows/deploy-docs.yaml +++ b/.github/workflows/deploy-docs.yaml @@ -8,9 +8,11 @@ on: paths: - 'docs/**' - .github/workflows/deploy-docs.yaml + # we need this in addition to push to build the docs when the PR is opened and not just on later pushes after it is open pull_request: paths: - 'docs/**' + types: [opened] jobs: @@ -34,6 +36,19 @@ jobs: PROJECT_ID: ${{ secrets.GKE_PROD_PROJECT }} steps: + # we do this before building the docs so that even if the docs fail building, we still have the comment on the PR for later once the build is fixed + # (we can't post the comment each time this workflow runs on we will have multiple comments, so we need to post it only once when the PR is opened) + - name: Post preview link on PR + if: github.event_name == 'pull_request' + env: + GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} + run: | + PR_NUMBER=$(echo ${{ github.event.pull_request.number }}) + PREVIEW_URL="https://docs.robusta.dev/${GITHUB_HEAD_REF}" + curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ + -d "{\"body\": \"🔍 [Preview Docs](${PREVIEW_URL})\n\n**Note: preview docs will only be available at this URL once the initial docs finish building!**\"}" \ + "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" + - name: Checkout uses: actions/checkout@v2 @@ -85,14 +100,3 @@ jobs: with: name: docs path: docs/_build/html - - - name: Post preview link on PR - if: github.event_name == 'pull_request' - env: - GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }} - run: | - PR_NUMBER=$(echo ${{ github.event.pull_request.number }}) - PREVIEW_URL="https://docs.robusta.dev/${GITHUB_HEAD_REF}" - curl -X POST -H "Authorization: token $GITHUB_TOKEN" \ - -d "{\"body\": \"🔍 [Preview Docs](${PREVIEW_URL})\"}" \ - "https://api.github.com/repos/${{ github.repository }}/issues/${PR_NUMBER}/comments" From 9ceb364e75cb61ab3eb6260f62f88a79af607a79 Mon Sep 17 00:00:00 2001 From: Robusta Runner Date: Tue, 18 Jun 2024 09:02:39 +0300 Subject: [PATCH 6/6] Revert "trigger docs build" This reverts commit 5da32c0dd89712ed1a11b0de3207c27a5ed14e59. --- docs/index.rst | 1 - 1 file changed, 1 deletion(-) diff --git a/docs/index.rst b/docs/index.rst index dc873dbb2..0ae72b44f 100644 --- a/docs/index.rst +++ b/docs/index.rst @@ -61,7 +61,6 @@ help - Welcome to the Robusta Docs ===============================