Linux 无法使用GitHub操作/Gitlab CI/CD通过SCP部署(超时)
我有一个React.js应用程序,我正在尝试使用Github操作进行自动部署。我遵循了Github在其操作页面上的一些示例。构建看起来是正确的,我将构建文件夹作为工件输出,但我正在尝试通过SCP将构建文件夹发送到远程服务器,但我的运行程序似乎没有internet连接,因为我接收到超时 我从我的机器上尝试了相同的scp命令,它工作得非常好 到目前为止,我的yaml是这样的:Linux 无法使用GitHub操作/Gitlab CI/CD通过SCP部署(超时),linux,github,gitlab,scp,github-actions,Linux,Github,Gitlab,Scp,Github Actions,我有一个React.js应用程序,我正在尝试使用Github操作进行自动部署。我遵循了Github在其操作页面上的一些示例。构建看起来是正确的,我将构建文件夹作为工件输出,但我正在尝试通过SCP将构建文件夹发送到远程服务器,但我的运行程序似乎没有internet连接,因为我接收到超时 我从我的机器上尝试了相同的scp命令,它工作得非常好 到目前为止,我的yaml是这样的: # This is a basic workflow to help you get started with Action
# This is a basic workflow to help you get started with Actions
name: CI
# Controls when the action will run. Triggers the workflow on push or pull request
# events but only for the master branch
on:
push:
branches: [ master ]
pull_request:
branches: [ master ]
# A workflow run is made up of one or more jobs that can run sequentially or in parallel
jobs:
# This workflow contains a single job called "build"
build:
# The type of runner that the job will run on
runs-on: [ubuntu-latest]
# Steps represent a sequence of tasks that will be executed as part of the job
steps:
# Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it
- uses: actions/checkout@v2
# Runs a set of commands using the runners shell
#sudo apt-get update && sudo apt-get install -y lftp && sudo rm -rf /var/lib/apt/lists/*
- name: Run a multi-line script
run: |
npm install
CI=false npm run-script build
- name: List output files
run: ls
- name: Create security file
run: |
touch securityfile
echo -e "${{ secrets.PRIVATE_KEY }}" >securityfile
chmod 600 securityfile
- name: Deploy via SCP
run: scp -o StrictHostKeyChecking=no -v -i securityfile -r build/ ${{ secrets.SSH_USER }}@${{ secrets.SSH_HOST }}:/www
我还尝试在GitLab中执行管道操作,但得到了相同的超时结果。您可以发布它通过scp部署的时间吗?您可以发布它通过scp部署的时间吗?