From 81ddc0b149a9bb78dce8804518d1132f0beb0850 Mon Sep 17 00:00:00 2001 From: Mara3l Date: Mon, 29 Apr 2024 16:42:45 +0200 Subject: [PATCH] ci: fix hugo - hugo had a wrong environment trivial --- .github/actions/hugo-build-action/action.yaml | 31 +++++-------------- .github/workflows/netlify-deploy-preview.yaml | 20 +++++------- 2 files changed, 14 insertions(+), 37 deletions(-) diff --git a/.github/actions/hugo-build-action/action.yaml b/.github/actions/hugo-build-action/action.yaml index 0de15a5c9..fd287fe46 100644 --- a/.github/actions/hugo-build-action/action.yaml +++ b/.github/actions/hugo-build-action/action.yaml @@ -2,35 +2,18 @@ name: Hugo Build description: Builds documentation using Hugo inputs: base-url: - required: false - description: Optional base url used during build - working-directory: - required: false - description: Path to documentation directory - default: docs - hugo-env: - required: false - description: Environment variable - default: public - fetch-from: - required: false - description: repo to fetch the versions from - default: origin + required: true + description: Base url used during build runs: using: "composite" steps: - - uses: actions/checkout@v4 - - name: Setup Python - uses: actions/setup-python@v5 - with: - python-version-file: ".python-version" - cache: 'pip' - cache-dependency-path: scripts/script-requirements.txt - - uses: actions/setup-go@v4 + - name: "Setup GO" + uses: actions/setup-go@v4 with: go-version: '>=1.20.1' - - uses: actions/setup-node@v3 + - name: "Setup Node" + uses: actions/setup-node@v3 with: node-version: 18 - name: "Setup Hugo" @@ -45,4 +28,4 @@ runs: run: | cd docs npm install - hugo --minify ${BASE_URL:+--baseURL $BASE_URL} + hugo --minify ${BASE_URL:+--baseURL $BASE_URL} -e _default diff --git a/.github/workflows/netlify-deploy-preview.yaml b/.github/workflows/netlify-deploy-preview.yaml index a0c2a3ee0..4db218f22 100644 --- a/.github/workflows/netlify-deploy-preview.yaml +++ b/.github/workflows/netlify-deploy-preview.yaml @@ -14,41 +14,35 @@ jobs: netlify-deploy: runs-on: infra1-rxa-xlarge steps: - - name: Checkout + - name: "Checkout Recursive" uses: actions/checkout@v4 with: submodules: recursive - - name: Checkout + - name: "Checkout to PR-tmp" uses: actions/checkout@v4 with: repository: ${{ github.event.pull_request.head.repo.full_name }} ref: ${{ github.event.pull_request.head.ref }} path: 'PR-tmp' - - name: Get only changed docs + - name: "Get only changed docs" run: | rsync --delete -av PR-tmp/docs/content/en/ docs/content/en/ rm -rf PR-tmp - - name: Generate Docs + - name: "Generate Docs" uses: gooddata/gooddata-python-sdk/.github/actions/hugo-build-action@master with: base-url: https://preview-${{ env.GITHUB_PR_NUMBER }}--${{ env.NETLIFY_SITE_NAME }}.netlify.app - - name: Publish + - name: "Publish" uses: netlify/actions/cli@master with: args: deploy -d docs/public --alias=preview-${{ env.GITHUB_PR_NUMBER }} env: NETLIFY_SITE_ID: 93e23db0-d31a-4a12-801a-b9479ffef486 # Not a secret NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }} -# `htmltest` is after publishing, so we can see the artifact. - - name: htmltest + # `htmltest` is after publishing, so we can see the artifact. + - name: "htmltest" run: | rm -f htmltest.sh wget https://raw.githubusercontent.com/gooddata/gooddata-python-sdk/master/scripts/htmltest.sh chmod +x ./htmltest.sh ./htmltest.sh -c docs/.htmltest.yml docs/public -# Commented out, because it has been failing. Check up later. -# - name: Comment PR -# uses: thollander/actions-comment-pull-request@v2 -# with: -# message: | -# https://preview-${{ env.GITHUB_PR_NUMBER }}--${{ env.NETLIFY_SITE_NAME }}.netlify.app/