burrow/.forgejo/workflows/build-site.yml
Conrad Kramer 1964d1fa6e
Some checks failed
Build Site / Next.js Build (push) Successful in 1m39s
Build Apple / Build App (macOS) (push) Has started running
Build Rust / Cargo Test (push) Failing after 3m35s
Build Apple / Build App (iOS Simulator) (push) Successful in 2m0s
Fix linux nix develop workflow shells
2026-03-19 04:26:11 -07:00

63 lines
1.7 KiB
YAML

name: Build Site
on:
push:
branches:
- main
pull_request:
branches:
- "**"
workflow_dispatch:
concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true
jobs:
site:
name: Next.js Build
runs-on: namespace-profile-linux-medium
env:
NIX_CONFIG: |
experimental-features = nix-command flakes
accept-flake-config = true
steps:
- name: Checkout
uses: https://code.forgejo.org/actions/checkout@v4
with:
token: ${{ github.token }}
fetch-depth: 0
- name: Prepare Cache Dirs
shell: bash
run: |
set -euo pipefail
cache_root="${NSC_CACHE_PATH:-${HOME}/.cache/burrow}"
shared_root="${NSC_SHARED_CACHE_PATH:-${cache_root}/shared}"
lane_root="${NSC_LANE_CACHE_PATH:-${cache_root}/lane/build-site}"
mkdir -p \
"${shared_root}/npm" \
"${shared_root}/xdg" \
"${lane_root}/next-cache"
echo "NPM_CONFIG_CACHE=${shared_root}/npm" >> "${GITHUB_ENV}"
echo "XDG_CACHE_HOME=${shared_root}/xdg" >> "${GITHUB_ENV}"
echo "NEXT_CACHE_DIR=${lane_root}/next-cache" >> "${GITHUB_ENV}"
{
echo 'NIX_CONFIG<<EOF'
printf '%s\n' "${NIX_CONFIG}"
echo 'EOF'
} >> "${GITHUB_ENV}"
df -h /nix "${shared_root}" "${lane_root}" || true
- name: Build
shell: bash
run: |
set -euo pipefail
nix develop .#ci -c bash -euo pipefail -c '
mkdir -p site/.next
rm -rf site/.next/cache
ln -sfn "${NEXT_CACHE_DIR}" site/.next/cache
cd site
npm install
npm run build
'