Skip to content

chore: fix hugo

chore: fix hugo #151

Workflow file for this run

name: Deploy Hugo site to Pages
on:
push:
branches:
- main
- docs
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
defaults:
run:
shell: bash
jobs:
build:
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.108.0
steps:
- name: Cache Hugo CLI
id: cache-hugo
uses: actions/cache@v3
with:
path: /usr/local/bin/hugo
key: ${{ runner.os }}-hugo-${{ env.HUGO_VERSION }}
restore-keys: |
${{ runner.os }}-hugo-
- name: Install Hugo CLI
if: steps.cache-hugo.outputs.cache-hit != 'true'
run: |
wget -O ${{ runner.temp }}/hugo.tar.gz https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_Linux-64bit.tar.gz \
&& tar -xzf ${{ runner.temp }}/hugo.tar.gz -C ${{ runner.temp }} \
&& sudo mv ${{ runner.temp }}/hugo /usr/local/bin/hugo
- name: Verify Hugo Installation
run: |
ls -l /usr/local/bin/hugo
/usr/local/bin/hugo version
- name: Install Dart Sass Embedded
run: sudo snap install dart-sass-embedded
- name: Checkout docs branch
uses: actions/checkout@v4
with:
ref: docs
submodules: recursive
- name: Fetch main branch
run: git fetch origin main:main
- name: Setup Pages
id: pages
uses: actions/configure-pages@v4
- name: Setup Node.js 20
uses: actions/setup-node@v4
with:
node-version: '20'
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Copy hTWOo Core style guide
run: git checkout main -- docs/htwoo-core/* && mv -f docs/htwoo-core public/htwoo-core/
- name: Copy hTWOo React style guide
run: git checkout main -- docs/htwoo-react/* && mv -f docs/htwoo-react public/htwoo-react/
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2