diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index eec2302..0a15236 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -33,7 +33,25 @@ jobs: echo "Cached sharp binary at $CACHE_FILE" fi fi - + - name: Build or restore resvg-js for FreeBSD + run: | + RESVG_VER=$(node -e "process.stdout.write(require('./node_modules/@resvg/resvg-js/package.json').version)") + CACHE_FILE=/usr/local/git/.cache/resvg-freebsd/resvgjs.freebsd-x64-${RESVG_VER}.node + if [ -f "$CACHE_FILE" ]; then + echo "Restoring cached resvg-js ${RESVG_VER}" + mkdir -p node_modules/@resvg/resvg-js/ + cp "$CACHE_FILE" node_modules/@resvg/resvg-js/resvgjs.freebsd-x64.node + else + echo "Building resvg-js ${RESVG_VER} from source..." + npm install --build-from-source @resvg/resvg-js + mkdir -p /usr/local/git/.cache/resvg-freebsd + BUILT=$(find node_modules/@resvg/resvg-js -name "resvgjs.freebsd-x64.node" | head -1) + if [ -n "$BUILT" ]; then + cp "$BUILT" "$CACHE_FILE" + echo "Cached resvg-js binary at $CACHE_FILE" + fi + fi + - name: Fetch homepage config from node jail run: | mkdir -p ~/.ssh