ci(workflow): 在scp和ssh命令中添加StrictHostKeyChecking参数
避免首次连接服务器时因主机密钥检查导致的部署失败
This commit is contained in:
parent
5f15efa9ea
commit
bff294f139
8
.github/workflows/auto-deploy-to-aliyun.yml
vendored
8
.github/workflows/auto-deploy-to-aliyun.yml
vendored
@ -35,7 +35,7 @@ jobs:
|
|||||||
script: |
|
script: |
|
||||||
# 创建或确保目标目录存在
|
# 创建或确保目标目录存在
|
||||||
mkdir -p /usr/share/nginx/html
|
mkdir -p /usr/share/nginx/html
|
||||||
# 将本地构建的 dist 目录内容复制到服务器的 nginx html 目录
|
# 将本地构建的 dist 目录内容复制到服务器的 nginx html 目录,添加 -o StrictHostKeyChecking=no 参数
|
||||||
scp -r ${{ github.workspace }}/docs/.vitepress/dist/* ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/usr/share/nginx/html/
|
scp -r -o StrictHostKeyChecking=no ${{ github.workspace }}/docs/.vitepress/dist/* ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }}:/usr/share/nginx/html/
|
||||||
# 重启 nginx 服务
|
# 重启 nginx 服务,添加 -o StrictHostKeyChecking=no 参数
|
||||||
sudo systemctl restart nginx
|
ssh -o StrictHostKeyChecking=no ${{ secrets.SERVER_USERNAME }}@${{ secrets.SERVER_IP }} "sudo systemctl restart nginx"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user