From 5c1f944f4f789c68035b8bff32c9083f6b8f8924 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 15:41:49 +0100 Subject: [PATCH 01/25] only checkout necessary directories --- .github/workflows/deploy-pr-preview.yml | 2 +- .github/workflows/deploy-preview.yml | 8 ++++++++ 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml index 198a2ffd0..01f2df4a5 100644 --- a/.github/workflows/deploy-pr-preview.yml +++ b/.github/workflows/deploy-pr-preview.yml @@ -11,7 +11,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 with: sha: ${{ github.event.pull_request.head.sha }} branch: ${{ github.head_ref }} diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 65b0c6ec0..07f0f914c 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -66,6 +66,8 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 if: github.event.action == 'opened' || github.event.action == 'synchronize' + with: + path: docs/sources # get the Dockerfile and nginx conf - name: Sparse checkout @@ -78,6 +80,12 @@ jobs: sparse-checkout: | deploy-preview + - name: List directories + if: github.event.action == 'opened' || github.event.action == 'synchronize' + shell: bash + run: | + ls -al + - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash From fb6adb27393c7d0b9c922abb8c77e3dce21d4a5f Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 15:42:13 +0100 Subject: [PATCH 02/25] trigger build --- .github/workflows/deploy-pr-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml index 01f2df4a5..8805d491b 100644 --- a/.github/workflows/deploy-pr-preview.yml +++ b/.github/workflows/deploy-pr-preview.yml @@ -6,8 +6,8 @@ on: - opened - synchronize - closed - paths: - - "docs/sources/**" + # paths: + # - "docs/sources/**" jobs: deploy-pr-preview: From d0d201638dc8a091791dd1b9c7f6515aeb28537a Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 15:43:29 +0100 Subject: [PATCH 03/25] ls source_dir --- .github/workflows/deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 07f0f914c..b2808676f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -85,6 +85,7 @@ jobs: shell: bash run: | ls -al + ls -al ${{ inputs.source_directory }} - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' From 654356599096d40c528ce9d70e17d9034f737b81 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 15:46:34 +0100 Subject: [PATCH 04/25] trigger build --- .github/workflows/deploy-pr-preview.yml | 4 ++-- docs/sources/_index.md | 1 + 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml index 8805d491b..01f2df4a5 100644 --- a/.github/workflows/deploy-pr-preview.yml +++ b/.github/workflows/deploy-pr-preview.yml @@ -6,8 +6,8 @@ on: - opened - synchronize - closed - # paths: - # - "docs/sources/**" + paths: + - "docs/sources/**" jobs: deploy-pr-preview: diff --git a/docs/sources/_index.md b/docs/sources/_index.md index 6d16ecf86..34a41ce32 100644 --- a/docs/sources/_index.md +++ b/docs/sources/_index.md @@ -39,3 +39,4 @@ If it's your first time using the guide, start with the [Get started](https://gr Writers' Toolkit is open source and available at [`grafana/writers-toolkit`](https://github.com/grafana/writers-toolkit). If you have questions, or feedback on how to improve this documentation, [open an issue](https://github.com/grafana/writers-toolkit/issues/new) and help make this an even better resource. +. From 57d7d9cca7f519dfaa7344a7c65b82db5783abc8 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:09:01 +0100 Subject: [PATCH 05/25] debug --- .github/workflows/deploy-preview.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index b2808676f..774cef5de 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -84,6 +84,7 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | + pwd ls -al ls -al ${{ inputs.source_directory }} From f19d87fb2c21bdf5fafbc4121946c2ae27bc059c Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:11:36 +0100 Subject: [PATCH 06/25] try sparse checkout --- .github/workflows/deploy-preview.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 774cef5de..f31675d1a 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -67,7 +67,9 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 if: github.event.action == 'opened' || github.event.action == 'synchronize' with: - path: docs/sources + path: ${{ inputs.source_directory }} + sparse-checkout: | + docs # get the Dockerfile and nginx conf - name: Sparse checkout From 5d1504203c7e78293908d1988b0d03bfda2afb51 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:12:37 +0100 Subject: [PATCH 07/25] disable cone mode --- .github/workflows/deploy-preview.yml | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index f31675d1a..06482e0a1 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -67,9 +67,8 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 if: github.event.action == 'opened' || github.event.action == 'synchronize' with: - path: ${{ inputs.source_directory }} - sparse-checkout: | - docs + parse-checkout-cone-mode: false + sparse-checkout: docs # get the Dockerfile and nginx conf - name: Sparse checkout From 5b3fce5b293ddce33f2f28e88059c055ce784cc4 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:41:02 +0100 Subject: [PATCH 08/25] try some bash --- .github/workflows/deploy-preview.yml | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 06482e0a1..faa840462 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -67,7 +67,7 @@ jobs: - uses: actions/checkout@11bd71901bbe5b1630ceea73d27597364c9af683 # v4.2.2 if: github.event.action == 'opened' || github.event.action == 'synchronize' with: - parse-checkout-cone-mode: false + sparse-checkout-cone-mode: false # exclude root files sparse-checkout: docs # get the Dockerfile and nginx conf @@ -87,7 +87,11 @@ jobs: run: | pwd ls -al - ls -al ${{ inputs.source_directory }} + trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) + ls -al $trimmed_value + find . -mindepth 1 ! -name '$trimmed_value' ! -name '.git' -exec rm -rf {} + + ls -al + ls -al $trimmed_value - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' From ac0dcc6332dcf71c0da5970eb687b4ab87738034 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:43:30 +0100 Subject: [PATCH 09/25] remove quotes --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index faa840462..f161a9b6f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -89,7 +89,7 @@ jobs: ls -al trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) ls -al $trimmed_value - find . -mindepth 1 ! -name '$trimmed_value' ! -name '.git' -exec rm -rf {} + + find . -mindepth 1 ! -name $trimmed_value ! -name '.git' -exec rm -rf {} + ls -al ls -al $trimmed_value From df7f6d7d7f70ead7d929a463cf36d36eb0ae4e8b Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:45:05 +0100 Subject: [PATCH 10/25] add deploy-preview dir --- .github/workflows/deploy-preview.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index f161a9b6f..69bceb1c8 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -81,7 +81,7 @@ jobs: sparse-checkout: | deploy-preview - - name: List directories + - name: Keep only necessary files if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | @@ -89,7 +89,7 @@ jobs: ls -al trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) ls -al $trimmed_value - find . -mindepth 1 ! -name $trimmed_value ! -name '.git' -exec rm -rf {} + + find . -mindepth 1 ! -name $trimmed_value ! -name deploy-preview ! -name '.git' -exec rm -rf {} + ls -al ls -al $trimmed_value From 9360df9eaf5c7c562c0944fe429fc25b10c56af1 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:45:46 +0100 Subject: [PATCH 11/25] typo --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 69bceb1c8..47c163a8f 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -89,7 +89,7 @@ jobs: ls -al trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) ls -al $trimmed_value - find . -mindepth 1 ! -name $trimmed_value ! -name deploy-preview ! -name '.git' -exec rm -rf {} + + find . -mindepth 1 ! -name $trimmed_value ! -name deploy-preview-files ! -name '.git' -exec rm -rf {} + ls -al ls -al $trimmed_value From 43672c6ca3623468039b5bbf5953889a894c3e5e Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:53:37 +0100 Subject: [PATCH 12/25] try exclusion --- .github/workflows/deploy-preview.yml | 13 +++++++------ 1 file changed, 7 insertions(+), 6 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 47c163a8f..37b4d5e58 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -68,7 +68,11 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' with: sparse-checkout-cone-mode: false # exclude root files - sparse-checkout: docs + sparse-checkout: | + /* + !/*.* # exclude all files in the root directory + /docs + /deploy-preview-files # get the Dockerfile and nginx conf - name: Sparse checkout @@ -81,17 +85,14 @@ jobs: sparse-checkout: | deploy-preview + # sparse checkout with cone mode disabled includes root files + # see https://github.com/actions/checkout/issues/1430#issuecomment-1756326892 - name: Keep only necessary files if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | pwd ls -al - trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) - ls -al $trimmed_value - find . -mindepth 1 ! -name $trimmed_value ! -name deploy-preview-files ! -name '.git' -exec rm -rf {} + - ls -al - ls -al $trimmed_value - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' From 6e4b770e8986f65d57ef55ccc9841b021b66c701 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 16:59:57 +0100 Subject: [PATCH 13/25] more bash --- .github/workflows/deploy-preview.yml | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 37b4d5e58..45efe5d58 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -68,11 +68,7 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' with: sparse-checkout-cone-mode: false # exclude root files - sparse-checkout: | - /* - !/*.* # exclude all files in the root directory - /docs - /deploy-preview-files + sparse-checkout: docs # get the Dockerfile and nginx conf - name: Sparse checkout @@ -93,6 +89,11 @@ jobs: run: | pwd ls -al + trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) + ls -al $trimmed_value + find . -mindepth 1 -not \( -path ./$trimmed_value -o -path ./$trimmed_value/* -o -path './deploy-preview-files' -o -path './deploy-preview-files/*' \) -exec rm -rf {} + + ls -al + ls -al $trimmed_value - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' From be3a5565b642529d35bbd005d2dba3766ca7cb1e Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 17:01:07 +0100 Subject: [PATCH 14/25] add quotes --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 45efe5d58..295bcfc7e 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -91,7 +91,7 @@ jobs: ls -al trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) ls -al $trimmed_value - find . -mindepth 1 -not \( -path ./$trimmed_value -o -path ./$trimmed_value/* -o -path './deploy-preview-files' -o -path './deploy-preview-files/*' \) -exec rm -rf {} + + find . -mindepth 1 -not \( -path './$trimmed_value' -o -path './$trimmed_value/*' -o -path './deploy-preview-files' -o -path './deploy-preview-files/*' \) -exec rm -rf {} + ls -al ls -al $trimmed_value From 212ba5888d656abaa7637b992d0fc96d9da8627c Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 17:02:27 +0100 Subject: [PATCH 15/25] change quotes --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 295bcfc7e..54aa0b6e0 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -91,7 +91,7 @@ jobs: ls -al trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) ls -al $trimmed_value - find . -mindepth 1 -not \( -path './$trimmed_value' -o -path './$trimmed_value/*' -o -path './deploy-preview-files' -o -path './deploy-preview-files/*' \) -exec rm -rf {} + + find . -mindepth 1 -not \( -path "./$trimmed_value" -o -path "./$trimmed_value/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + ls -al ls -al $trimmed_value From f4955845e4c88688aad4130550833c85e90253f1 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 17:04:49 +0100 Subject: [PATCH 16/25] cleanup --- .github/workflows/deploy-preview.yml | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 54aa0b6e0..3112c2352 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -81,16 +81,13 @@ jobs: sparse-checkout: | deploy-preview - # sparse checkout with cone mode disabled includes root files + # sparse checkout with cone mode disabled includes root files, even when using exclusions # see https://github.com/actions/checkout/issues/1430#issuecomment-1756326892 - name: Keep only necessary files if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | - pwd - ls -al trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) - ls -al $trimmed_value find . -mindepth 1 -not \( -path "./$trimmed_value" -o -path "./$trimmed_value/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + ls -al ls -al $trimmed_value From c40453d4731dae1a4b9b876a1cc5d453eac20842 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 17:06:40 +0100 Subject: [PATCH 17/25] try without trim --- .github/workflows/deploy-preview.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 3112c2352..3c2be94c8 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -87,8 +87,7 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | - trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) - find . -mindepth 1 -not \( -path "./$trimmed_value" -o -path "./$trimmed_value/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + + find . -mindepth 1 -not \( -path "./${{ inputs.source_directory }}" -o -path "./${{ inputs.source_directory }}/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + ls -al ls -al $trimmed_value From fafdea980b7a270908b8b787dc8a80cf47fcc554 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 17:11:29 +0100 Subject: [PATCH 18/25] revert trim removal --- .github/workflows/deploy-preview.yml | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 3c2be94c8..3112c2352 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -87,7 +87,8 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | - find . -mindepth 1 -not \( -path "./${{ inputs.source_directory }}" -o -path "./${{ inputs.source_directory }}/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + + trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) + find . -mindepth 1 -not \( -path "./$trimmed_value" -o -path "./$trimmed_value/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + ls -al ls -al $trimmed_value From 2d3b6c918065b5109be279f3f2ffa629c340c06b Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 17:14:37 +0100 Subject: [PATCH 19/25] remove trim --- .github/workflows/deploy-preview.yml | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 3112c2352..3c2be94c8 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -87,8 +87,7 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | - trimmed_value=$(echo "${{ inputs.source_directory }}" | cut -d'/' -f1) - find . -mindepth 1 -not \( -path "./$trimmed_value" -o -path "./$trimmed_value/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + + find . -mindepth 1 -not \( -path "./${{ inputs.source_directory }}" -o -path "./${{ inputs.source_directory }}/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + ls -al ls -al $trimmed_value From 13a93f76b3748163144b4e3618279e4c57952c91 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Thu, 28 Nov 2024 17:16:54 +0100 Subject: [PATCH 20/25] hardcode docs dir --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 3c2be94c8..4c82225b1 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -87,7 +87,7 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | - find . -mindepth 1 -not \( -path "./${{ inputs.source_directory }}" -o -path "./${{ inputs.source_directory }}/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + + find . -mindepth 1 -not \( -path "./docs" -o -path "./docs/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + ls -al ls -al $trimmed_value From de7c5287b829a52a7ab2357fe873c2b01f044064 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Fri, 29 Nov 2024 09:24:05 +0100 Subject: [PATCH 21/25] simplify --- .github/workflows/deploy-preview.yml | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 4c82225b1..918d8045c 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -87,9 +87,10 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | - find . -mindepth 1 -not \( -path "./docs" -o -path "./docs/*" -o -path "./deploy-preview-files" -o -path "./deploy-preview-files/*" \) -exec rm -rf {} + ls -al - ls -al $trimmed_value + shopt -s extglob + rm -rf !(docs|deploy-preview|.git) + ls -al - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' From 964d9fff30c8422fe58de6aa7760bae12590c8e3 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Fri, 29 Nov 2024 09:28:00 +0100 Subject: [PATCH 22/25] fix dir --- .github/workflows/deploy-preview.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 918d8045c..92fb31a95 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -89,7 +89,7 @@ jobs: run: | ls -al shopt -s extglob - rm -rf !(docs|deploy-preview|.git) + rm -rf !(docs|deploy-preview-files|.git) ls -al - name: Build website From 839a4beb910ea85c03756fcf6fbb1d68a6f73b33 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Fri, 29 Nov 2024 09:31:25 +0100 Subject: [PATCH 23/25] test --- .github/workflows/deploy-preview.yml | 3 --- 1 file changed, 3 deletions(-) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 92fb31a95..25b1f1deb 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -88,9 +88,6 @@ jobs: shell: bash run: | ls -al - shopt -s extglob - rm -rf !(docs|deploy-preview-files|.git) - ls -al - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' From 09544788c1d02141d37424170561a0d0c79b96e1 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Fri, 29 Nov 2024 09:36:01 +0100 Subject: [PATCH 24/25] test --- .github/workflows/deploy-preview.yml | 3 +++ 1 file changed, 3 insertions(+) diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 25b1f1deb..9656cdf1e 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -87,7 +87,10 @@ jobs: if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | + shopt -s extglob + rm -rf !(docs|deploy-preview-files|.git) ls -al + ls -al ${{ inputs.source_directory }} - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' From 5db56126d7b0c6d246c9b990d336f45a0da869d6 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Fri, 29 Nov 2024 09:47:08 +0100 Subject: [PATCH 25/25] revert content and ref changes --- .github/workflows/deploy-pr-preview.yml | 2 +- docs/sources/_index.md | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/.github/workflows/deploy-pr-preview.yml b/.github/workflows/deploy-pr-preview.yml index 01f2df4a5..198a2ffd0 100644 --- a/.github/workflows/deploy-pr-preview.yml +++ b/.github/workflows/deploy-pr-preview.yml @@ -11,7 +11,7 @@ on: jobs: deploy-pr-preview: - uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@robbymilo/deploy-preview + uses: grafana/writers-toolkit/.github/workflows/deploy-preview.yml@main with: sha: ${{ github.event.pull_request.head.sha }} branch: ${{ github.head_ref }} diff --git a/docs/sources/_index.md b/docs/sources/_index.md index 34a41ce32..6d16ecf86 100644 --- a/docs/sources/_index.md +++ b/docs/sources/_index.md @@ -39,4 +39,3 @@ If it's your first time using the guide, start with the [Get started](https://gr Writers' Toolkit is open source and available at [`grafana/writers-toolkit`](https://github.com/grafana/writers-toolkit). If you have questions, or feedback on how to improve this documentation, [open an issue](https://github.com/grafana/writers-toolkit/issues/new) and help make this an even better resource. -.