Skip to content

chore(nix->guix): delete Nix estate-wide (#138) #486

chore(nix->guix): delete Nix estate-wide (#138)

chore(nix->guix): delete Nix estate-wide (#138) #486

Workflow file for this run

# SPDX-License-Identifier: MPL-2.0
# This workflow is managed by gh actions-lock.
name: GitHub Pages
on:
push:
branches: [main, master]
workflow_dispatch:
permissions:
actions: read
contents: read
pages: write
id-token: write
concurrency:
group: "pages"
cancel-in-progress: false
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 30
steps:
- name: Checkout
uses: actions/checkout@v7.0.1
- name: Checkout casket-ssg
uses: actions/checkout@v7.0.1
with:
repository: hyperpolymath/casket-ssg
path: .casket-ssg
- name: Setup GHCup
uses: haskell-actions/setup@v2.12.0
with:
ghc-version: '9.8.2'
cabal-version: '3.10'
- name: Cache Cabal
uses: actions/cache@v6.1.0
with:
path: |
~/.cabal/packages
~/.cabal/store
.casket-ssg/dist-newstyle
key: ${{ runner.os }}-casket-${{ hashFiles('.casket-ssg/casket-ssg.cabal') }}
- name: Build casket-ssg
working-directory: .casket-ssg
run: cabal build
- name: Prepare site source
shell: bash
run: |
set -euo pipefail
rm -rf .site-src _site
if [ -d site ]; then
cp -R site .site-src
else
mkdir -p .site-src
TODAY="$(date +%Y-%m-%d)"
REPO_NAME="${{ github.event.repository.name }}"
REPO_URL="https://github.com/${{ github.repository }}"
README_URL=""
if [ -f README.md ]; then
README_URL="${REPO_URL}/blob/${{ github.ref_name }}/README.md"
elif [ -f README.adoc ]; then
README_URL="${REPO_URL}/blob/${{ github.ref_name }}/README.adoc"
fi
{
echo "---"
echo "title: ${REPO_NAME}"
echo "date: ${TODAY}"
echo "---"
echo
echo "# ${REPO_NAME}"
echo
echo "Static documentation site for ${REPO_NAME}."
echo
echo "- Source repository: [${{ github.repository }}](${REPO_URL})"
if [ -n "${README_URL}" ]; then
echo "- README: [project README](${README_URL})"
fi
if [ -d docs ]; then
echo "- Docs directory: [docs/](${REPO_URL}/tree/${{ github.ref_name }}/docs)"
fi
echo
echo "Project-specific site content can be added later under site/."
} > .site-src/index.md
fi
- name: Build site
run: |
mkdir -p _site
cd .casket-ssg && cabal run casket-ssg -- build ../.site-src ../_site
touch ../_site/.nojekyll
- name: Setup Pages
uses: actions/configure-pages@v6.0.0
- name: Upload artifact
uses: actions/upload-pages-artifact@v5.0.0
with:
path: '_site'
deploy:
environment:
name: github-pages
url: ${{ steps.deployment.outputs.page_url }}
runs-on: ubuntu-latest
needs: build
timeout-minutes: 10
steps:
- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v5.0.0