Files
mcpedia/.github/workflows/deploy.yml
T
asepharyana e8ed5980fc
CI / typecheck + build (turbo) (push) Canceled after 0s
fix: deploy script — replace broken bun --cwd with subshell cd for VPS build
The 'bun --cwd apps/web run build' on VPS was silently failing —
bun doesn't support --cwd flag, printed usage, exited 0. Then on
the GitHub runner, turbo couldn't find package manager binary.
Fix: use 'cd apps/web && bun run build && cd ..' in SSH script.
CI build step also uses turbo --filter for proper workspace isolation.
2026-08-21 11:24:47 +07:00

54 lines
1.5 KiB
YAML

name: Deploy
on:
workflow_run:
workflows: ["CI"]
types: [completed]
branches: [main]
concurrency:
group: deploy-${{ github.ref }}
cancel-in-progress: true
jobs:
deploy:
name: build + deploy
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Set up Bun
uses: oven-sh/setup-bun@v2
with:
bun-version: "1.3.14"
- name: Install dependencies
run: bun install --frozen-lockfile
- name: Typecheck
run: bun run typecheck
- name: Build web app
run: bun run build --filter=@mcpedia/web
- name: Deploy to VPS over SSH
uses: appleboy/ssh-action@v1
with:
host: ${{ secrets.SSH_DEPLOY_HOST }}
port: ${{ secrets.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
key: ${{ secrets.SSH_DEPLOY_KEY }}
envs: SSH_DEPLOY_HOST
script: |
set -e
cd /home/code/mcpedia
git pull origin main
/home/code/.bun/bin/bun install --frozen-lockfile
cd apps/web && /home/code/.bun/bin/bun run build && cd /home/code/mcpedia
/home/code/.bun/bin/bun run scripts/indexer.ts
sudo systemctl restart mcpedia-web mcpedia-api mcpedia-mcp mcpedia-worker
sleep 3
systemctl --no-pager status mcpedia-web mcpedia-api mcpedia-mcp mcpedia-worker --no-legend