我使用 ci/cd 的第一步,并尝试为我的宠物项目设置 CircleCI。
我在 digitalocean 上安装了 VPS 服务器,并希望在build
faze 之后,dist
文件夹的内容将通过scp
. 我config.yml
的如下:
version: 2.1
executors:
my-executor:
docker:
- image: circleci/node:12.9.1-browsers
working_directory: ~/repo
jobs:
build:
executor: my-executor
steps:
- checkout
- restore_cache:
keys:
- v1-dependencies-{{ checksum "package.json" }}
# fallback to using the latest cache if no exact match is found
- v1-dependencies-
- run: yarn install
- save_cache:
paths:
- node_modules
- ~/.npm
- ~/.cache
key: v1-dependencies-{{ checksum "package.json" }}
- run: yarn build
deploy:
executor: my-executor
steps:
- run:
name: Deploy Over SSH
command: |
scp -r dist/* $SERVER_USER_NAME@$SERVER_IP:/var/www/example.com/html
workflows:
version: 2
build-deploy:
jobs:
- build
- deploy:
requires:
- build
build
完美地工作,但deploy
工作卡住了,我只看到这条消息:
#!/bin/bash -eo pipefail
scp -r dist/* $SERVER_USER_NAME@$SERVER_IP:/var/www/example.com/html
The authenticity of host '************ (************)' can't be established.
ECDSA key fingerprint is SHA256:Yu/i9AcPRAJtyT43QrQMdI3tSB3*************.
我已将私有 ssh 密钥添加到 circleci 并将公钥添加到authorized_keys
我哪里错了?谢谢你。