All checks were successful
Build and deploy static pages / build-and-push (push) Successful in 19s
53 lines
1.7 KiB
YAML
53 lines
1.7 KiB
YAML
name: Build and deploy static pages
|
|
|
|
on:
|
|
push:
|
|
branches: [main]
|
|
workflow_dispatch:
|
|
|
|
env:
|
|
HUGO_VERSION: "0.165.0"
|
|
# Public URL served by the gitea-pages proxy. Override with a repo variable
|
|
# (Settings → Actions → Variables → SITE_BASE_URL) if the site moves.
|
|
SITE_BASE_URL: ${{ vars.SITE_BASE_URL || format('https://pub.sqrt.fr/{0}/', github.repository) }}
|
|
|
|
jobs:
|
|
build-and-push:
|
|
runs-on: ubuntu-latest
|
|
|
|
permissions:
|
|
contents: write
|
|
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
with:
|
|
# site/themes/PaperMod is a submodule
|
|
submodules: recursive
|
|
|
|
- name: Install Hugo
|
|
run: |
|
|
mkdir -p "$HOME/.local/bin"
|
|
curl -sSfL "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.tar.gz" \
|
|
| tar -xz -C "$HOME/.local/bin" hugo
|
|
echo "$HOME/.local/bin" >> "$GITHUB_PATH"
|
|
"$HOME/.local/bin/hugo" version
|
|
|
|
- name: Install site JS dependencies
|
|
# site/assets/js/calendar.js imports @fullcalendar/* — Hugo's js.Build
|
|
# resolves those from site/node_modules at build time.
|
|
working-directory: site
|
|
run: npm ci
|
|
|
|
- name: Build site
|
|
# Content under site/content/ is generated by ./build.sh and committed,
|
|
# so CI only renders it — no data fetching happens here.
|
|
run: hugo --source site --minify --gc --baseURL "$SITE_BASE_URL"
|
|
|
|
- name: Deploy site
|
|
uses: peaceiris/actions-gh-pages@v4
|
|
with:
|
|
github_token: ${{ secrets.GITHUB_TOKEN }}
|
|
force_orphan: true
|
|
publish_branch: gh-pages
|
|
publish_dir: ./site/public
|