Skip to content

Commit

Permalink
ci: fix hugo
Browse files Browse the repository at this point in the history
- hugo had a wrong environment

trivial
  • Loading branch information
Mara3l committed Apr 30, 2024
1 parent 320d5cd commit 81ddc0b
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 37 deletions.
31 changes: 7 additions & 24 deletions .github/actions/hugo-build-action/action.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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"
Expand All @@ -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
20 changes: 7 additions & 13 deletions .github/workflows/netlify-deploy-preview.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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/

0 comments on commit 81ddc0b

Please sign in to comment.