From c712b833c359ee028c850afbbe280fb71a65ade3 Mon Sep 17 00:00:00 2001 From: Robby Milo Date: Wed, 4 Dec 2024 10:38:13 +0100 Subject: [PATCH] test script --- .github/workflows/deploy-preview.yml | 15 +-------------- deploy-preview/build.sh | 8 ++++++++ 2 files changed, 9 insertions(+), 14 deletions(-) create mode 100755 deploy-preview/build.sh diff --git a/.github/workflows/deploy-preview.yml b/.github/workflows/deploy-preview.yml index 76ce3f60c..78514519d 100644 --- a/.github/workflows/deploy-preview.yml +++ b/.github/workflows/deploy-preview.yml @@ -95,24 +95,11 @@ jobs: ls -al ls -al ${{ inputs.source_directory }} - - name: Create _index file - id: create-index - if: inputs.index_file == true - shell: bash - run: | - create_index_command=$("echo -e '---\\nredirectURL:\\s\/docs/${{ inputs.repo }}/latest/\\ntype:\\sredirect\\nversioned:\\strue\\n---\\n' > content/docs/${{ inputs.repo }}/_index.md &&") - echo "create_index_command=$create_index_command" >> $GITHUB_OUTPUT - - name: Build website if: github.event.action == 'opened' || github.event.action == 'synchronize' shell: bash run: | - docker run \ - -v "${PWD}/dist:/hugo/dist" \ - -v "${PWD}/${{ inputs.source_directory }}:/hugo/${{ inputs.website_directory }}" \ - --rm grafana/docs-base:latest \ - /bin/bash \ - -c '${{ steps.create-index.outputs.create_index_command }}HUGO_SSI=false hugo --environment=docs --destination=dist/ --baseURL= --minify' + ./deploy-preview/build.sh - name: Print build header value if: github.event.action == 'opened' || github.event.action == 'synchronize' diff --git a/deploy-preview/build.sh b/deploy-preview/build.sh new file mode 100755 index 000000000..12998ada1 --- /dev/null +++ b/deploy-preview/build.sh @@ -0,0 +1,8 @@ +#!/usr/bin/env bash + +docker run \ + -v "${PWD}/dist:/hugo/dist" \ + -v "${PWD}/${{ inputs.source_directory }}:/hugo/${{ inputs.website_directory }}" \ + --rm grafana/docs-base:latest \ + /bin/bash \ + -c 'HUGO_SSI=false hugo --environment=docs --destination=dist/ --baseURL= --minify' \ No newline at end of file