Skip to content

Commit

Permalink
hugo-configure
Browse files Browse the repository at this point in the history
  • Loading branch information
bernhardkaindl committed Jan 27, 2025
1 parent 4c9e7a7 commit df1bbba
Showing 1 changed file with 13 additions and 8 deletions.
21 changes: 13 additions & 8 deletions .github/workflows/hugo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,22 +52,26 @@ jobs:
allow_empty_commit: false
enable_jekyll: true # do not create .nojekyll file

- name: Build to deploy to a clone's GitHub Pages for documentation update reviews
- name: If vars.PREVIEW_HUGO_DOCS is true, enable github pages for the preview
if: ${{ vars.PREVIEW_HUGO_DOCS == 'true' }}
id: configure-pages
uses: actions/configure-pages@v5

- name: If vars.PREVIEW_HUGO_DOCS is true, build the hugo preview
if: ${{ vars.PREVIEW_HUGO_DOCS == 'true' }}
id: preview
env:
# Override the Hugo baseUrl in doc/hugo.toml with the repo name for doc reviews:
HUGO_BASEURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/
run: cd doc;hugo --minify
# HUGO_BASEURL: https://${{ github.repository_owner }}.github.io/${{ github.event.repository.name }}/
HUGO_BASE_URL: ${{ steps.configure-pages.outputs.base_url }}
run: cd doc;hugo --minify;done=true" >$GITHUB_OUTPUT

- name: Upload Hugo static site as an artifact for documentation update reviews
- name: If vars.PREVIEW_HUGO_DOCS is true, upload the Hugo site as an artifact
if: ${{ vars.PREVIEW_HUGO_DOCS == 'true' }}
uses: actions/upload-pages-artifact@v3
with:
path: ./doc/public

- id: preview
if: ${{ vars.PREVIEW_HUGO_DOCS == 'true' }}
run: echo "done=true" >$GITHUB_OUTPUT

# When pushed to other repositories, deploy to the repository's GitHub Pages
preview-docs:
Expand All @@ -91,6 +95,7 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Deploy uploaded artifact to GitHub Pages for documentation update reviews
if: ${{ vars.PREVIEW_HUGO_DOCS == 'true' || needs.hugo.outputs.preview == 'true' }}
if: ${{ needs.hugo.outputs.preview == 'true' }}
# if: ${{ vars.PREVIEW_HUGO_DOCS == 'true' || needs.hugo.outputs.preview == 'true' }}
id: deployment
uses: actions/deploy-pages@v4

0 comments on commit df1bbba

Please sign in to comment.