...
Some checks reported errors
continuous-integration/drone/push Build encountered an error
continuous-integration/drone Build is failing

This commit is contained in:
2025-10-14 21:15:25 +08:00
parent 4210517cdd
commit 75ed2c6d12
4 changed files with 75 additions and 8 deletions

View File

@@ -8,8 +8,73 @@ platform:
arch: amd64
steps:
- name: build
image: node:23-alpine
commands:
- npm ci
- npm run build
- name: build
image: node:23-alpine
commands:
- npm ci
- npm run build
- name: package
image: node:23-alpine
environment:
ZHIPU_API_KEY:
from_secret: zhipu_api_key
commands:
- apk add zip
- cd .next/standalone
- echo "ZHIPU_API_KEY="$ZHIPU_API_KEY > .env
- zip -r /dist/learn-languages.zip *
volumes:
- name: debian-dist
path: /dist
- name: transfer file
image: appleboy/drone-scp
settings:
host:
from_secret: SSH_HOST
username:
from_secret: SSH_USERNAME
key:
from_secret: SSH_KEY
port: 22
target: /home/debian
source:
- /dist/learn-languages.zip
rm_target: true
strip_components: 1
debug: true
volumes:
- name: debian-dist
path: /dist
- name: deploy
image: appleboy/drone-ssh
settings:
host:
from_secret: ssh_host
username:
from_secret: ssh_username
key:
from_secret: ssh_key
port: 22
script:
- cd ~/
- unzip -d learn-languages -o learn-languages.zip
- rm learn-languages.zip
- cd learn-languages
- |
if pm2 list | grep -q learn-languages; then
echo "进程 learn-languages 已在pm2中运行正在重启..."
pm2 restart "learn-languages"
else
echo "进程 learn-languages 未在pm2中运行正在启动..."
pm2 start "./server.js" --name "learn-languages"
fi
- pm2 save
debug: true
volumes:
- name: debian-dist
host:
path: /home/debian/dist