Skip to content

Commit

Permalink
Bumping actions
Browse files Browse the repository at this point in the history
Signed-off-by: Ian Allison <[email protected]>
  • Loading branch information
ianabc committed Jul 6, 2024
1 parent 2ae1f74 commit 2037c4d
Showing 1 changed file with 29 additions and 26 deletions.
55 changes: 29 additions & 26 deletions .github/workflows/publish.yaml
Original file line number Diff line number Diff line change
@@ -1,12 +1,11 @@
name: Deploy website to GitHub Pages

env:
WC_HUGO_VERSION: '0.119.0'

on:
# Trigger the workflow every time you push to the `main` branch
push:
branches: ["main"]
branches:
- main

# Allows you to run this workflow manually from the Actions tab on GitHub.
workflow_dispatch:

Expand All @@ -20,47 +19,51 @@ concurrency:
group: "pages"
cancel-in-progress: false

defaults:
run:
shell: bash

jobs:
# Build website
build:
if: github.repository_owner != 'HugoBlox'
runs-on: ubuntu-latest
env:
HUGO_VERSION: 0.119.0
steps:
- name: Install Hugo CLI
run: |
wget -O ${{ runner.temp }}/hugo.deb https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb \
&& sudo dpkg -i ${{ runner.temp }}/hugo.deb
- name: Install Dart Sass
run: sudo snap install dart-sass
- name: Checkout
uses: actions/checkout@v4
with:
# Fetch history for Hugo's .GitInfo and .Lastmod
submodules: recursive
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: ${{ env.WC_HUGO_VERSION }}
extended: true
- uses: actions/cache@v3
with:
path: /tmp/hugo_cache_runner/
key: ${{ runner.os }}-hugomod-${{ hashFiles('**/go.mod') }}
restore-keys: |
${{ runner.os }}-hugomod-
- name: Setup Pages
id: pages
uses: actions/configure-pages@v3
uses: actions/configure-pages@v4
- name: Install Node.js dependencies
run: "[[ -f package-lock.json || -f npm-shrinkwrap.json ]] && npm ci || true"
- name: Build with Hugo
env:
# For maximum backward compatibility with Hugo modules
HUGO_ENVIRONMENT: production
HUGO_ENV: production
TZ: Europe/Madrid
run: |
echo "Hugo Cache Dir: $(hugo config | grep cachedir)"
hugo --minify --baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Generate Pagefind search index
run: npx pagefind --source "public"
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
- name: Upload artifact
uses: actions/upload-pages-artifact@v2
uses: actions/upload-pages-artifact@v3
with:
path: ./public

# Deploy website to GitHub Pages hosting
# Deployment job
deploy:
if: github.repository_owner != 'HugoBlox'
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
Expand All @@ -69,4 +72,4 @@ jobs:
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
uses: actions/deploy-pages@v4

0 comments on commit 2037c4d

Please sign in to comment.