ci: add sharp binary cache + fix syndication internal URL
This commit is contained in:
@@ -14,8 +14,26 @@ jobs:
|
|||||||
- name: Install dependencies
|
- name: Install dependencies
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Build sharp from source for FreeBSD
|
- name: Build or restore sharp for FreeBSD
|
||||||
run: npm install node-addon-api node-gyp && npm install sharp --build-from-source
|
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
|
- name: Fetch homepage config from node jail
|
||||||
run: |
|
run: |
|
||||||
@@ -123,6 +141,7 @@ jobs:
|
|||||||
env:
|
env:
|
||||||
SECRET: ${{ secrets.SECRET }}
|
SECRET: ${{ secrets.SECRET }}
|
||||||
SITE_URL: ${{ secrets.SITE_URL }}
|
SITE_URL: ${{ secrets.SITE_URL }}
|
||||||
|
INDIEKIT_INTERNAL_URL: http://10.100.0.20:3000
|
||||||
run: |
|
run: |
|
||||||
npm install --no-save jsonwebtoken
|
npm install --no-save jsonwebtoken
|
||||||
TOKEN=$(node --input-type=commonjs <<'EOF'
|
TOKEN=$(node --input-type=commonjs <<'EOF'
|
||||||
@@ -138,7 +157,7 @@ jobs:
|
|||||||
RESPONSE=$(curl -sS -w "\n%{http_code}" -X POST \
|
RESPONSE=$(curl -sS -w "\n%{http_code}" -X POST \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-d "{\"access_token\": \"$TOKEN\"}" \
|
-d "{\"access_token\": \"$TOKEN\"}" \
|
||||||
"$SITE_URL/syndicate")
|
"$INDIEKIT_INTERNAL_URL/syndicate")
|
||||||
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
|
HTTP_CODE=$(echo "$RESPONSE" | tail -1)
|
||||||
BODY=$(echo "$RESPONSE" | head -n -1)
|
BODY=$(echo "$RESPONSE" | head -n -1)
|
||||||
echo "HTTP $HTTP_CODE: $BODY"
|
echo "HTTP $HTTP_CODE: $BODY"
|
||||||
|
|||||||
Reference in New Issue
Block a user