【问题标题】:github action failing? tar empty archive, docker run failed with exit code 1github操作失败? tar 空存档,docker run 失败,退出代码为 1
【发布时间】:2020-04-19 09:10:51
【问题描述】:

这是项目结构:

- parent/
|- .github/workflows/
|- frontend/
|- ...

这是工作流中的 .yml 文件:

name: CI

on:
  push:
    branches:
      - master

jobs:
  build:

    runs-on: ubuntu-latest

    steps:
    - uses: actions/checkout@v1
    - uses: actions/setup-node@v1
      with:
        node-version: "12.x"

    - name: Install dependencies
      working-directory: frontend
      run: npm install

    - name: Build
      working-directory: frontend
      run: npm run build

    - name: Deploy Files
      uses: appleboy/scp-action@master
      env:
        HOST: ${{  secrets.aws_pull_host }}
        USERNAME: ${{ secrets.aws_pull_username }}
        KEY: ${{ secrets.aws_pull_private_key }}
      with:
        working-directory: frontend
        source: build/
        target: "/home/build/site/testDir/"
        strip_components: 1

每当操作到达步骤Deploy Files 时,我都会收到错误消息:

tar: empty archive
tar all files into /tmp/891353322/bC24rHhFAi.tar
exit status 1
##[error]Docker run failed with exit code 1

第一次使用 github 操作,所以我很迷失这个错误。感谢任何帮助。

【问题讨论】:

    标签: github yaml github-actions


    【解决方案1】:

    一直在搞砸,终于弄明白了:

    - name: Deploy Files
          uses: appleboy/scp-action@master
          env:
            HOST: ${{  secrets.aws_pull_host }}
            USERNAME: ${{ secrets.aws_pull_username }}
            KEY: ${{ secrets.aws_pull_private_key }}
          with:
            source: frontend/build/
            target: "/home/build/site/testDir/"
            strip_components: 1
    

    【讨论】:

      猜你喜欢
      • 2021-03-26
      • 2022-01-16
      • 2020-10-10
      • 1970-01-01
      • 2023-02-18
      • 2019-06-14
      • 1970-01-01
      • 2017-07-14
      • 1970-01-01
      相关资源
      最近更新 更多