Failing deploys

Hello,
We build our website using Next.js 10.x and host it on Netlify. It’s a public repo where we keep both the content and the website’s code, https://github.com/livechat/livechat-public-docs. Netlify URL is https://livechat-public-docs.netlify.app.

We used GitHub Actions for deployment for quite some time with success. Two weeks ago, all deploys started failing. Even a small copy change caused the Page not found error. I downloaded one of the copies of the failed deploys from the deploy logs page. There wasn’t any index.html or any other page file.

I’m trying to investigate why our deploys started failing. Has something changed on the Netlify’s side that could result in such an outcome?

What is more interesting, generating deploy previews via GH Actions works fine. Using Netlify CLI for deploying to production works perfectly fine as well. Deploy ID that was built with CLI - 632c687bf4b19535050398df. Failed Deploy ID made with GitHub Actions - 6322e3cff5f3e07c9fea9caa.

Here is the mentioned GitHub Action:

name: Deploy branch

on:
  push:
    branches:
      - master

jobs:
  deployer:
    name: "Deploy"
    runs-on: macos-latest
    timeout-minutes: 45

    steps:
      - uses: actions/checkout@v2
      - uses: actions/setup-node@v2
        with:
          node-version: "14"

      - name: Install Dependencies
        run: npm install

      - name: Install Netlify CLI
        run: npm install netlify-cli -g

      - name: Deploy changes
        env:
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
        run: netlify build --context production  && netlify deploy --prod --dir=.next

Hey @Artur_Fracala,

From what we can see, for 6322e3cff5f3e07c9fea9caa deploy, there were no redirects:

I believe that deploy lacks the redirects required by Next.js to work on Netlify. Why? I’m not a 100% sure - mostly because, since that build is not really happening on Netlify, there’s very limited information available with us. We can almost only check the final output, that the output is missing the _redirects file.

The deploy that worked: 632c687bf4b19535050398df, has the _redirects file and thus, it appears to be working.

Maybe that would give you some clue to investigate?

Thanks @hrishikesh for advice :slight_smile: Really appreciate that

I wonder why final output depends on deploy method. Shouldn’t _redirects file be also missing when I use Netlify CLI?

Well, even when using GitHub Actions, you’re technically using Netlify CLI, just in a different environment than your local PC, perhaps. So I’m not really sure about the difference in behaviour. What happens when you change your CLI command to netlify deploy --build --prod?