fix(ci): 测试流水线对齐硬化版,钥匙走runner挂载不再依赖Secrets
This commit is contained in:
1 parent
99b13c310b
commit
c28d518327
1 file changed
+10
-6
@@ -26,12 +26,16 @@ jobs:
|
||||
with:
|
||||
ref: master
|
||||
|
||||
- name: Setup SSH key (from secrets)
|
||||
- name: Setup SSH key (runner mount, no secrets needed)
|
||||
run: |
|
||||
mkdir -p ~/.ssh
|
||||
printf '%s\n' "${{ secrets.PERLER_DEPLOY_KEY }}" > ~/.ssh/id_ed25519_deploy
|
||||
chmod 600 ~/.ssh/id_ed25519_deploy
|
||||
ssh-keyscan -H ${{ secrets.PERLER_DEPLOY_HOST }} >> ~/.ssh/known_hosts 2>/dev/null
|
||||
export HOME=/root
|
||||
mkdir -p ~/.ssh && chmod 700 ~/.ssh
|
||||
# 钥匙来源:runner container.options 透进来的宿主机钥匙
|
||||
# (prod2 /opt/act-runner-data/config.yaml),组织库无 Secrets 可用
|
||||
if [ ! -f /data/id_deploy ]; then echo "ERROR: /data/id_deploy 缺失,检查 runner 挂载"; exit 1; fi
|
||||
cp /data/id_deploy ~/.ssh/id_ed25519_deploy && chmod 600 ~/.ssh/id_ed25519_deploy
|
||||
ssh-keygen -lf ~/.ssh/id_ed25519_deploy
|
||||
ssh-keyscan -H 156.233.226.86 >> ~/.ssh/known_hosts 2>/dev/null
|
||||
echo "SSH 密钥就绪"
|
||||
|
||||
- name: Build images
|
||||
@@ -50,7 +54,7 @@ jobs:
|
||||
- name: Deploy to test env (156.233.226.86)
|
||||
run: |
|
||||
set -e
|
||||
HOST="${{ secrets.PERLER_DEPLOY_HOST }}"
|
||||
HOST="156.233.226.86"
|
||||
SSH_CMD="ssh -i $HOME/.ssh/id_ed25519_deploy root@$HOST"
|
||||
|
||||
# 生成测试环境专用 compose(自带 PG,镜像来自 registry,数据卷持久化)
|
||||
|
||||
Reference in new issue
Block a user