Commit a4a436a5 by 罗启

Add new file

parent 20acbefd
Pipeline #3153 failed with stage
in 1 second
# .gitlab-ci.yml
deploy_to_production:
stage: deploy
image: alpine:latest
# --- 在这里添加 tags 部分 ---
tags:
- jarvis # 指定使用带有 "jarvis" 标签的 Runner
# ---------------------------
# before_script, script, only 这些部分保持不变
before_script:
- 'which ssh-agent || ( apk add --update --no-cache openssh-client )'
- eval $(ssh-agent -s)
- echo "$SSH_PRIVATE_KEY" | tr -d '\r' | ssh-add -
- mkdir -p ~/.ssh
- chmod 700 ~/.ssh
- echo "$SSH_KNOWN_HOSTS" > ~/.ssh/known_hosts
- chmod 644 ~/.ssh/known_hosts
script:
- |
ssh -p $SSH_PORT $SSH_USER@$SSH_HOST "
echo '✅ 连接服务器成功,开始执行部署脚本...'
cd performance-score
git pull origin master
docker compose up -d --build
echo '🚀 部署流程执行完毕!'
"
only:
- master
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment