scp-action
scp-action copied to clipboard
How to use work-directory setting?
I find the work-directory setting in yml is ignored.
post your config.
@appleboy I am facing the same issue. If I set working-directory as below:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
and later if I use scp-action as below:
jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: frontend
strategy:
matrix:
node-version: [14.x]
# See supported Node.js release schedule at https://nodejs.org/en/about/releases/
steps:
- uses: actions/checkout@v2
- name: Use Node.js ${{ matrix.node-version }}
uses: actions/setup-node@v2
with:
node-version: ${{ matrix.node-version }}
- run: npm install && npx vite build && ls -la
- name: Upload dist content via scp
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
with:
source: dist/*
target: ${{ secrets.PROJECTDIR }}
it can't find dist directory generated in frontend directory. Instead if I write like below:
- name: Upload dist content via scp
uses: appleboy/scp-action@master
env:
HOST: ${{ secrets.HOST }}
USERNAME: ${{ secrets.USERNAME }}
PORT: ${{ secrets.PORT }}
KEY: ${{ secrets.SSHKEY }}
with:
source: frontend/dist/*
target: ${{ secrets.PROJECTDIR }}
it works. So, it is not respecting working-directory.