test/user-journey #3

Merged
zhangxiang merged 142 commits from test/user-journey into dev 2026-04-12 13:17:03 +08:00
Showing only changes of commit 4761850502 - Show all commits
+25 -24
View File
@@ -1,5 +1,5 @@
variables: variables:
- &node_image node:20-alpine - &node_image node:20-slim
steps: steps:
install-deps: install-deps:
@@ -112,29 +112,30 @@ steps:
- dev - dev
build-and-deploy: build-and-deploy:
image: node:20-alpine image: *node_image
environment: environment:
NODE_ENV: production NODE_ENV: production
NEXT_TELEMETRY_DISABLED: 1 NEXT_TELEMETRY_DISABLED: 1
SSH_PRIVATE_KEY: SSH_PRIVATE_KEY:
from_secret: ssh_private_key from_secret: ssh_private_key
depends_on: depends_on:
- install-deps - install-deps
- lint - lint
- type-check - type-check
commands: commands:
- echo "Installing SSH client" - echo "Checking SSH client availability"
- apk add --no-cache openssh-client rsync - which ssh && echo "SSH client found" || echo "Installing SSH client"
- echo "Building production artifacts" - apt-get update && apt-get install -y openssh-client rsync
- npm run build - echo "Building production artifacts"
- echo "Build completed" - npm run build
- ls -la dist/ - echo "Build completed"
- echo "Deploying to production" - ls -la dist/
- mkdir -p ~/.ssh - echo "Deploying to production"
- echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa - mkdir -p ~/.ssh
- chmod 600 ~/.ssh/id_rsa - echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa
- echo "Pre-deployment checks" - chmod 600 ~/.ssh/id_rsa
- ssh root@139.155.109.62 "echo 'Server connection OK'" - echo "Pre-deployment checks"
- ssh root@139.155.109.62 "echo 'Server connection OK'"
- ssh root@139.155.109.62 "df -h | grep -E '/$|/home'" - ssh root@139.155.109.62 "df -h | grep -E '/$|/home'"
- echo "Syncing build artifacts to production server" - echo "Syncing build artifacts to production server"
- rsync -avz --delete dist/ root@139.155.109.62:/home/novalon/docker-app/novalon-website/dist/ - rsync -avz --delete dist/ root@139.155.109.62:/home/novalon/docker-app/novalon-website/dist/