mirror of
https://github.com/Kizuren/kizuren.dev.git
synced 2025-12-21 13:06:11 +01:00
27 lines
No EOL
688 B
YAML
27 lines
No EOL
688 B
YAML
name: Deploy to Production
|
|
|
|
on:
|
|
push:
|
|
branches: [ main ]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: SSH and deploy
|
|
uses: appleboy/ssh-action@master
|
|
with:
|
|
host: ${{ secrets.SSH_HOST }}
|
|
username: ${{ secrets.SSH_USERNAME }}
|
|
key: ${{ secrets.SSH_PRIVATE_KEY }}
|
|
port: ${{ secrets.SSH_PORT }}
|
|
script: |
|
|
cd /var/www/marcus7i.net
|
|
git pull
|
|
npm ci
|
|
npm run build
|
|
pm2 reload ecosystem.config.cjs || pm2 start ecosystem.config.cjs --env production --env-path=".env"
|
|
|
|
# For system restarts
|
|
pm2 save |