【发布时间】:2022-01-17 12:49:11
【问题描述】:
我在 Debian 8 服务器上安装了 GitHub Actions 运行程序。我正在尝试构建一个 .NET 应用程序并将其复制到另一个目录。构建部分工作正常,但我无法复制文件。
我尝试先使用“sudo mkdir -p ...”创建目录,然后尝试使用“sudo cp -r ... ...”复制文件。这些步骤不会失败,在日志中显示“shell:/usr/bin/bash -e {0}”并且什么都不做。我不能创建目录,也不能复制文件。
有人知道我忽略了什么吗?首先,我认为这是因为“sudos”,运行程序需要密码输入,但我配置了无密码 sudo,我也可以运行其他 sudo 命令。
name: github-actions
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: "dotnet build"
run: dotnet build --configuration Release
- run: sudo mkdir -p "/opt/my_project/server"
- name: copy files
run: sudo cp -r "/home/runner/work/common/common/Server/bin/Release/net5.0" "/opt/my_project/server"
- run: sudo systemctl start my_project
【问题讨论】:
-
你试过不使用
sudo吗?
标签: continuous-integration debian github-actions debian-jessie