Skip to content
This repository was archived by the owner on Mar 24, 2026. It is now read-only.

init: first documentation snippets #1

init: first documentation snippets

init: first documentation snippets #1

Workflow file for this run

name: Build and deploy
on:
push:
branches:
- main
workflow_dispatch:
permissions:
contents: read
pages: write
id-token: write
concurrency:
group: pages
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@08c6903cd8c0fde910a37f88322edcfb5dd907a8 # v5
with:
submodules: recursive
fetch-depth: 0
- name: Install Hugo
shell: bash
env:
DEBIAN_FRONTEND: noninteractive
run: |
DOWNLOAD_URL=$(curl "https://api.github.com/repos/gohugoio/hugo/releases/latest" | jq -r '.assets[] | select(.name| test("hugo_0.*_linux-amd64.tar.gz$")).browser_download_url')
curl -fsSLo ./hugo.tar.gz "$DOWNLOAD_URL" --retry 3
tar xf ./hugo.tar.gz
- name: Cache restore
id: cache-restore
uses: actions/cache/restore@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}/hugo_cache
key: hugo-${{ github.run_id }}
restore-keys: hugo-
- name: Build the site
run: |
./hugo \
--gc \
--minify \
--cacheDir "${{ runner.temp }}/hugo_cache"
- name: Cache save
id: cache-save
uses: actions/cache/save@0057852bfaa89a56745cba8c7296529d2fc39830 # v4
with:
path: ${{ runner.temp }}/hugo_cache
key: ${{ steps.cache-restore.outputs.cache-primary-key }}
- name: Upload artifact
uses: actions/upload-pages-artifact@7b1f4a764d45c48632c6b24a0339c27f5614fb0b # 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@d6db90164ac5ed86f2b6aed7e0febac5b3c0c03e # v4