github 操作失败?tar 空存档,docker 运行失败,退出代码为 1

Syn*_*Syn 4 yaml github github-actions

这是项目结构:

- parent/
|- .github/workflows/
|- frontend/
|- ...
Run Code Online (Sandbox Code Playgroud)

这是工作流程中的 .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
Run Code Online (Sandbox Code Playgroud)

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

tar: empty archive
tar all files into /tmp/891353322/bC24rHhFAi.tar
exit status 1
##[error]Docker run failed with exit code 1
Run Code Online (Sandbox Code Playgroud)

第一次使用 github actions,所以我对这个错误感到非常困惑。感谢任何帮助。

Syn*_*Syn 5

折腾了好久,终于明白了:

- 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
Run Code Online (Sandbox Code Playgroud)