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.
 
 
 
 
 
 

38 lines
839 B

kind: pipeline
type: exec
name: build-and-deploy
platform:
os: linux
arch: amd64
steps:
- name: build
commands:
- cd web && 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-site .
- name: deploy
environment:
DB_PATH:
from_secret: db_path
JWT_SECRET:
from_secret: jwt_secret
ADMIN_USER:
from_secret: admin_user
ADMIN_PASS:
from_secret: admin_pass
commands:
- mkdir -p /opt/person-site
- sudo cp person-site /opt/person-site/person-site
- sudo pkill -x person-site || true
- |
sudo -E nohup /opt/person-site/person-site >> /tmp/person-site.log 2>&1 &
when:
branch: main
trigger:
branch:
- main