项目结构如下:
- 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操作,所以我对这个错误感到非常困惑。感谢任何人的帮助。
发布于 2019-12-31 04:45:37
一直在胡乱摆弄,终于弄明白了:
- 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: 1https://stackoverflow.com/questions/59533930
复制相似问题