Skip to content

fix: change directory scp #2

fix: change directory scp

fix: change directory scp #2

Workflow file for this run

# .github/workflows/deploy.yml
name: Deploy Documentation
on:
push:
branches: [ main ]
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Setup Node.js
uses: actions/setup-node@v4
with:
node-version: '22'
cache: 'npm'
- name: Install dependencies
run: npm ci
- name: Build
run: npm run build
- name: Deploy to server
uses: appleboy/scp-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
source: ".next/,public/,package.json,package-lock.json"
target: "/var/www/fastfony/main/docs"
- name: Execute deployment commands
uses: appleboy/ssh-action@master
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USER }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
script: |
cd /var/www/fastfony/main/docs
npm ci --production
pm2 reload ecosystem.config.js || pm2 start ecosystem.config.js