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/"