deploy a subdirectory succeeds on GitHub Actions but gets No build command found on Netlify
https://stackoverflow.com/questions/64518447/deploy-to-netlify-github-actions-not-working
I'm trying to deploy a subdirectory of my repo to netlify, client, and it's not working, the GitHub action actually succeeds but the netlify deploy log says "No build command found, continuing to publishing",
my yml file:
defaults:
run:
working-directory: client
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- name: Use Node.js 14
uses: actions/setup-node@v1
with:
node-version: 14.10.1
- name: install client dependencies
run: npm ci
working-directory: client
- run: npm run build
working-directory: client
- name: Netlify Deploy
uses: netlify/actions/build@master
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
NETLIFY_DIR: build
I've also changed it to
NETLIFY_BASE: client
NETLIFY_CMD: npm build
NETLIFY_DIR: client/build
and same thing
facing the same problem. Have you found a fix?
Update: got it working. had the wrong build directory as a flag, was /build but changed to build.
- name: Deploy to netlify
uses: netlify/actions/cli@master
with:
args: deploy --dir=build --prod
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
I'm facing a similar problem. This is part of my Github Workflow:
- name: Deploy to Netlify
uses: netlify/actions/cli@master
with:
args: deploy --dir=build/web
...
However, when there is no build/web directory (due to my mistake), the Netlify action prints an error:
› Error: No such directory /github/workspace/build/web! Did you forget to
› run a build?
But the build succeeds which it shouldn't in my opinion.