Skip to content

ci: deploy to server #10

ci: deploy to server

ci: deploy to server #10

Workflow file for this run

name: Deploy to Server
on:
workflow_dispatch:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: pnpm/[email protected]
with:
version: latest
- uses: actions/setup-node@v4
with:
node-version: "20"
cache: "pnpm"
- run: corepack enable
# Pick your own package manager and build script
- run: pnpm install
- run: pnpm exec nuxi build --preset node-server
- name: Upload artifact
uses: actions/upload-artifact@v4
with:
name: node-server
path: ./.output
# Deployment job
deploy:
# Add a dependency to the build job
needs: build
runs-on: ubuntu-latest
steps:
- name: Deploy using SSH to Server
uses: appleboy/[email protected]
with:
host: ${{ secrets.DEPLOY_HOST }}
username: ${{ secrets.DEPLOY_USERNAME }}
key: ${{ secrets.DEPLOY_SSH_KEY }}
script: |
cd campu
bash deploy.sh