github操作失败?tar空存档,docker运行失败,退出代码为1
这是项目结构:github操作失败?tar空存档,docker运行失败,退出代码为1,github,yaml,github-actions,Github,Yaml,Github Actions,这是项目结构: - 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
- 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
无论何时操作进入步骤部署文件
,我都会收到错误:
tar: empty archive
tar all files into /tmp/891353322/bC24rHhFAi.tar
exit status 1
##[error]Docker run failed with exit code 1
第一次使用github操作,所以我对这个错误非常迷茫。感谢您的帮助。不停地捣乱,最后终于解决了:
- 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