Skip to content

Migrate to multi-page Hugo website and add project infrastructure #99

Migrate to multi-page Hugo website and add project infrastructure

Migrate to multi-page Hugo website and add project infrastructure #99

Workflow file for this run

name: GitHub Pages
on:
push:
branches:
- main
pull_request:
jobs:
deploy:
if: github.repository == 'uapi-group/kernel-features'
runs-on: ubuntu-22.04
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
steps:
- uses: actions/checkout@v4
with:
submodules: true
fetch-depth: 0
- name: Setup Hugo
uses: peaceiris/actions-hugo@v2
with:
hugo-version: '0.147.8'
extended: true
- name: Build
run: cd website && hugo --minify -d ../public
- name: Validate front matter
run: |
errors=0
for f in $(find website/content -name '*.md' ! -name '_index.md'); do
if ! head -1 "$f" | grep -q '^---$'; then
echo "ERROR: $f missing front matter"
errors=$((errors + 1))
fi
done
if [ "$errors" -gt 0 ]; then
echo "$errors file(s) with missing front matter"
exit 1
fi
- name: Deploy
uses: peaceiris/actions-gh-pages@v3
if: ${{ github.ref == 'refs/heads/main' }}
with:
github_token: ${{ secrets.GITHUB_TOKEN }}
publish_dir: ./public