diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml index e7a50df..617714c 100644 --- a/.github/workflows/deploy.yml +++ b/.github/workflows/deploy.yml @@ -14,8 +14,26 @@ jobs: - name: Install dependencies run: npm ci - - name: Build sharp from source for FreeBSD - run: npm install node-addon-api node-gyp && npm install sharp --build-from-source + - name: Build or restore sharp for FreeBSD + run: | + SHARP_VER=$(node -e "process.stdout.write(require('./node_modules/sharp/package.json').version)") + CACHE_FILE=/usr/local/git/.cache/sharp-freebsd/sharp-freebsd-x64-${SHARP_VER}.node + if [ -f "$CACHE_FILE" ]; then + echo "Restoring cached sharp ${SHARP_VER}" + DEST=$(find node_modules/sharp -name "build.js" -path "*/install/*" | head -1 | xargs dirname | xargs dirname) + mkdir -p "$DEST/build/Release" + cp "$CACHE_FILE" "$DEST/build/Release/sharp-freebsd-x64.node" + else + echo "Building sharp ${SHARP_VER} from source..." + npm install node-addon-api node-gyp + npm install sharp --build-from-source + mkdir -p /usr/local/git/.cache/sharp-freebsd + BUILT=$(find node_modules/sharp -name "sharp-freebsd-x64.node" | head -1) + if [ -n "$BUILT" ]; then + cp "$BUILT" "$CACHE_FILE" + echo "Cached sharp binary at $CACHE_FILE" + fi + fi - name: Fetch homepage config from node jail run: | @@ -123,6 +141,7 @@ jobs: env: SECRET: ${{ secrets.SECRET }} SITE_URL: ${{ secrets.SITE_URL }} + INDIEKIT_INTERNAL_URL: http://10.100.0.20:3000 run: | npm install --no-save jsonwebtoken TOKEN=$(node --input-type=commonjs <<'EOF' @@ -138,7 +157,7 @@ jobs: RESPONSE=$(curl -sS -w "\n%{http_code}" -X POST \ -H "Content-Type: application/json" \ -d "{\"access_token\": \"$TOKEN\"}" \ - "$SITE_URL/syndicate") + "$INDIEKIT_INTERNAL_URL/syndicate") HTTP_CODE=$(echo "$RESPONSE" | tail -1) BODY=$(echo "$RESPONSE" | head -n -1) echo "HTTP $HTTP_CODE: $BODY"