Some checks failed
Deploy / deploy (push) Has been cancelled
Full-stack web application for Telegram management - Frontend: Vue 3 + Vben Admin - Backend: NestJS - Features: User management, group broadcast, statistics 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com>
59 lines
1.8 KiB
YAML
59 lines
1.8 KiB
YAML
name: Deploy
|
|
|
|
on:
|
|
push:
|
|
branches: ["main"]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
deploy:
|
|
runs-on: ubuntu-latest
|
|
env:
|
|
DEPLOY_HOST: ${{ secrets.DEPLOY_HOST }}
|
|
DEPLOY_USER: ${{ secrets.DEPLOY_USER }}
|
|
DEPLOY_PASSWORD: ${{ secrets.DEPLOY_PASSWORD }}
|
|
DEPLOY_PORT: ${{ secrets.DEPLOY_PORT || '22' }}
|
|
|
|
steps:
|
|
- name: Checkout repository
|
|
uses: actions/checkout@v4
|
|
|
|
- name: Prepare deployment archive
|
|
run: |
|
|
mkdir -p release
|
|
tar czf release/release.tar.gz \
|
|
--exclude='./.git' \
|
|
--exclude='./.github' \
|
|
--exclude='./release.tar.gz' \
|
|
--exclude='./node_modules' \
|
|
--exclude='*/node_modules' \
|
|
--exclude='./logs' \
|
|
--exclude='*/logs' \
|
|
--exclude='*.log' \
|
|
.
|
|
|
|
- name: Upload bundle to server
|
|
uses: appleboy/scp-action@v0.1.7
|
|
with:
|
|
host: ${{ env.DEPLOY_HOST }}
|
|
username: ${{ env.DEPLOY_USER }}
|
|
password: ${{ env.DEPLOY_PASSWORD }}
|
|
port: ${{ env.DEPLOY_PORT }}
|
|
source: "release/release.tar.gz,deploy/remote-deploy.sh"
|
|
target: "/tmp/telegram-management-system"
|
|
|
|
- name: Deploy on remote host
|
|
uses: appleboy/ssh-action@v0.1.10
|
|
with:
|
|
host: ${{ env.DEPLOY_HOST }}
|
|
username: ${{ env.DEPLOY_USER }}
|
|
password: ${{ env.DEPLOY_PASSWORD }}
|
|
port: ${{ env.DEPLOY_PORT }}
|
|
script: |
|
|
set -euo pipefail
|
|
chmod +x /tmp/telegram-management-system/deploy/remote-deploy.sh
|
|
/tmp/telegram-management-system/deploy/remote-deploy.sh \
|
|
/tmp/telegram-management-system/release/release.tar.gz \
|
|
/opt/telegram-management-system \
|
|
docker-compose.yml
|