You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

41 lines
1.1 KiB

# Drone exec runner pipeline — runs directly on the target host.
# Host must have Go 1.26+, Node 24+.
kind: pipeline
type: exec
name: build-and-deploy
platform:
os: linux
arch: amd64
steps:
- name: build
commands:
- cd frontend && npm ci && npm run build && cd ..
- go env -w GO111MODULE=on
- go env -w GOPROXY=https://goproxy.cn,direct
- go build -ldflags="-s -w" -o person-home .
- name: deploy
environment:
ADMIN_PASSWORD:
from_secret: admin_password
JWT_SECRET:
from_secret: jwt_secret
DB_PATH:
from_secret: db_path
UPLOAD_DIR:
from_secret: upload_dir
CORS_ORIGIN:
from_secret: cors_origin
commands:
- mkdir -p /opt/person-home
- sudo cp person-home /opt/person-home/person-home
- sudo sh -c 'pkill -x person-home || true; nohup env ADMIN_PASSWORD=$ADMIN_PASSWORD JWT_SECRET=$JWT_SECRET DB_PATH=$DB_PATH UPLOAD_DIR=$UPLOAD_DIR CORS_ORIGIN=$CORS_ORIGIN /opt/person-home/person-home >> /tmp/person-home.log 2>&1 &'
when:
branch: main
trigger:
branch:
- main