【问题标题】:GitHub Actions mkdir doesn't do anythingGitHub Actions mkdir 不做任何事情
【发布时间】: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


【解决方案1】:

好的,我想我找到了答案。我必须是“运行:自托管”,并且我认为 GitHub Runner 在 Debian 8 上无法正常工作。

【讨论】:

    猜你喜欢
    • 2020-10-14
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-08-15
    相关资源
    最近更新 更多