Skip to content

landing: landingkit v0.29.0 #65

landing: landingkit v0.29.0

landing: landingkit v0.29.0 #65

Workflow file for this run

# Build + deploy the Hugo site to GitHub Pages on every push to main.
# Adapted from the official Hugo template at
# https://gohugo.io/host-and-deploy/host-on-github-pages/.
name: Deploy Hugo site to Pages
on:
push:
branches: [main]
# Build on every pull request too, so a change to the layout, the content or
# the Hugo version has to prove the site still builds before it lands.
# Without this the workflow ran only on main, which meant a dependency bump
# arrived with no signal at all -- its checks read "no checks", which is not
# the same thing as green and must not be merged as if it were.
pull_request:
workflow_dispatch:
# Allow only one concurrent deployment, skipping runs queued between
# the run in-progress and latest queued. Don't cancel in-progress
# runs — we want them to finish before a new build replaces them.
concurrency:
group: "pages"
cancel-in-progress: false
# The build needs nothing beyond the source and the Pages configuration it
# reads to compute the base URL. Publishing rights are granted to the deploy
# job alone, below, so a pull request build cannot replace what is served.
permissions:
contents: read
pages: read
env:
# Pin Hugo so site builds don't break when a new release ships
# incompatible template changes. Bump deliberately, not by
# surprise.
HUGO_VERSION: 0.135.0
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Install Hugo CLI
run: |
wget -O hugo.deb "https://github.com/gohugoio/hugo/releases/download/v${HUGO_VERSION}/hugo_extended_${HUGO_VERSION}_linux-amd64.deb"
sudo dpkg -i hugo.deb
- name: Checkout
uses: actions/checkout@v7
with:
submodules: recursive
- name: Setup Pages
id: pages
uses: actions/configure-pages@v6
# Hugo resolves the landingkit module (hugo.toml [module]) with the go
# command, at the version go.mod pins.
- name: Setup Go
uses: actions/setup-go@v7
with:
go-version-file: go.mod
cache: false
- name: Build
env:
HUGO_ENVIRONMENT: production
HUGO_ENV: production
run: |
hugo \
--gc \
--minify \
--baseURL "${{ steps.pages.outputs.base_url }}/"
# The landing kit's own rules, read from the BUILT site (a hand-written
# cta row, a playground link that is not btn-try, a fact said twice).
- name: Check the landing against the kit
env:
GOWORK: "off"
run: go run github.com/go-fleettools/landingkit/cmd/landingkit check public
- name: Upload artifact
uses: actions/upload-pages-artifact@v5
with:
path: ./public
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
permissions:
contents: read
pages: write
id-token: write
# Only main publishes. A pull request stops after build above: it has built
# the site, which is the whole point of the gate, and it has no business
# replacing what is served.
if: github.event_name == 'push' || github.event_name == 'workflow_dispatch'
needs: build
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5