Files
mcpedia/.github/workflows/deploy.yml
T
asepharyana 596d3cf616 fix: correct artifact name in deploy (mcpedia-web-build not mcpedia-web-standalone)
CI uploads artifact as 'mcpedia-web-build', deploy downloads 'mcpedia-web-build'.
Also fix SCP source path: .next/* not standalone/***.
2026-08-21 11:46:15 +07:00

60 lines
1.8 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: deploy to VPS
if: ${{ github.event.workflow_run.conclusion == 'success' }}
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v5
- name: Download build artifact
uses: actions/download-artifact@v4
with:
name: mcpedia-web-build
path: .next
- name: Copy pre-built .next to VPS
uses: appleboy/scp-action@v1
with:
host: ${{ secrets.SSH_DEPLOY_HOST }}
port: ${{ secrets.SSH_DEPLOY_PORT }}
username: ${{ secrets.SSH_DEPLOY_USER }}
key: ${{ secrets.SSH_DEPLOY_KEY }}
source: ".next/*"
target: "/home/code/mcpedia/apps/web/.next"
- 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
# Pull latest code (for content, .env, and non-web changes)
git pull origin main
/home/code/.bun/bin/bun install --frozen-lockfile
/home/code/.bun/bin/bun run scripts/indexer.ts
# The .next/ was just copied from CI (pre-built, no build on VPS)
# Restart services to pick up the new build
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