Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

deploy a subdirectory succeeds on GitHub Actions but gets No build command found on Netlify #40

Open
laila-chammaa opened this issue Oct 26, 2020 · 2 comments

Comments

@laila-chammaa
Copy link

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

@bcarter97
Copy link

bcarter97 commented Dec 23, 2020

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 }}

@jindrazak
Copy link

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants