From 295bcf7ec7519dc396b4a0d4ce93e069958327a3 Mon Sep 17 00:00:00 2001 From: Andrei Jiroh Halili Date: Sun, 7 Dec 2025 03:08:55 +0000 Subject: [PATCH] ci: implement more compat work at Spindle CI workflow for builds Also some fixes on the build script for fix some missing variables Signed-off-by: Andrei Jiroh Halili --- .tangled/workflows/site-deploy.yml | 11 ++++++++--- bin/build.sh | 5 ++++- 2 files changed, 12 insertions(+), 4 deletions(-) diff --git a/.tangled/workflows/site-deploy.yml b/.tangled/workflows/site-deploy.yml index 9f32058..6b3c16d 100644 --- a/.tangled/workflows/site-deploy.yml +++ b/.tangled/workflows/site-deploy.yml @@ -29,23 +29,28 @@ dependencies: - libjpeg - zlib - pngquant + # needed to generate LD_LIBRARY_PATH for cairo and friends + - findutils environment: CI: "true" # https://tangled.org/tangled.org/core/issues/310 (resolved via merging https://tangled.org/tangled.org/core/pulls/843) # GitLab CI compatibility for some of our scripts that check these variables (for branch names # and commit hashes, we simply use `git rev-parse` directly) CI_PIPELINE_SOURCE: "push" + # technically we have --ingore-pipfile in the install command below, but just to be safe + PIPENV_IGNORE_PIPFILE: "true" + # steps: - name: Install deps command: | pipenv install --deploy --ignore-pipfile npm ci - environment: - PIPENV_IGNORE_PIPFILE: "true" # We configured our wrangler.toml to use our build script (at ../../bin/build.sh) # for building the site and doing post-build prep (like copying well-known files # and such). To minimize admin overhead on secrets management, we use `doppler run` # to inject secrets from Doppler into the environment for the build and deploy steps. - name: Deploy to Cloudflare Workers (as Static Site) - command: doppler run -- npm run deploy:cf \ No newline at end of file + command: | + export LD_LIBRARY_PATH=$(find /nix/store -maxdepth 3 -type d -name lib | grep -E 'cairo|pango|gdk-pixbuf|librsvg|fontconfig|freetype|zlib' | tr '\n' ':') + doppler run -- npm run deploy:cf \ No newline at end of file diff --git a/bin/build.sh b/bin/build.sh index 6d0aa11..68057b9 100755 --- a/bin/build.sh +++ b/bin/build.sh @@ -1,7 +1,10 @@ #!/usr/bin/env bash set -ex -TARGET_DIR="${PWD}/public" +GIT_ROOT=$(git rev-parse --show-toplevel) +SOURCE_DIR="${GIT_ROOT}/markdown" +TARGET_DIR="${GIT_ROOT}/public" + pipenv run build cp "$TARGET_DIR/assets/images/favicon.png" "$TARGET_DIR/favicon.ico" -v cp "$SOURCE_DIR/.well-known" "$TARGET_DIR/" -rv -- 2.51.2