The runner omits optional deps, dropping @img/sharp-linux-x64 (sharps own optional platform package). --include=optional forces it back in. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
42 lines
1.2 KiB
YAML
42 lines
1.2 KiB
YAML
name: Build & Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: [master, main]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- uses: actions/checkout@v4
|
|
|
|
- name: Setup Node
|
|
uses: actions/setup-node@v4
|
|
with:
|
|
node-version: 22
|
|
|
|
# npm (not bun) + --include=optional so Sharp's platform binary
|
|
# (@img/sharp-linux-x64, an optional dep) installs on the runner,
|
|
# which otherwise omits optional deps -> astro:assets MissingSharp
|
|
- name: Install dependencies
|
|
run: npm install --include=optional
|
|
|
|
- name: Build site
|
|
run: npm run build
|
|
|
|
- name: Deploy dist/ to CT148 over SSH
|
|
env:
|
|
DEPLOY_HOST: 192.168.10.148
|
|
DEPLOY_USER: root
|
|
DEPLOY_PATH: /var/www/asger
|
|
run: |
|
|
set -euo pipefail
|
|
mkdir -p ~/.ssh
|
|
echo "${{ secrets.DEPLOY_SSH_KEY }}" > ~/.ssh/deploy_key
|
|
chmod 600 ~/.ssh/deploy_key
|
|
ssh-keyscan -t ed25519 "$DEPLOY_HOST" >> ~/.ssh/known_hosts 2>/dev/null || true
|
|
rsync -az --delete \
|
|
-e "ssh -i ~/.ssh/deploy_key -o StrictHostKeyChecking=accept-new" \
|
|
dist/ "$DEPLOY_USER@$DEPLOY_HOST:$DEPLOY_PATH/"
|