Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

github action failing? tar empty archive, docker run failed with exit code 1

This is the project structure:

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

This is the .yml file within workflows:

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

Whenever the action gets to the step Deploy Files, i get the error:

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

First time working with github actions so I am pretty lost with this error. Appreciate any help.

like image 863
Syn Avatar asked Oct 21 '25 12:10

Syn


1 Answers

Kept messing with it, finally figured it out:

- 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
like image 148
Syn Avatar answered Oct 23 '25 08:10

Syn



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!