Open lucasggmc opened 2 years ago
Could you show me the source?
That is my full .yml file
name: ci
on:
push:
branches:
- main
jobs:
build:
runs-on: ubuntu-latest
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
steps:
- name: Checkout repository!
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Setup Node
uses: actions/setup-node@v1
with:
node-version: ^14.19.1
- name: Install dependencies
run: yarn --frozen-lockfile
- name: Run Jest tests
run: yarn test
- name: Deploy to Netlify
uses: nwtgck/actions-netlify@v1.2
env:
NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}
with:
publish-dir: './public'
production-branch: main
production-deploy: true
timeout-minutes: 2
Thanks. The yaml doesn't seem to contain a build process. You need yarn build
or something.
I think there are a few issues here.
.next/
if using next build
or out
if using next build && next export
, so updating the publish-dir to one of those directories should get you closer to a solution.Having said that, I tried using this Github action to produce the Next.js runtime and it doesn't seem to be respecting it. Not sure if there is an option to include the build flag as a part of the process.
The equivalent command using Netlify Actions would be deploy --build
.
I see most projects use three dirs for nextjs, e.g. https://github.com/leerob/next-self-host/blob/main/Dockerfile#L20 [public, .next/standalone, .next/static]
Also, the build step from https://github.com/netlify-templates/next-platform-starter plus this action with publish-dir: '.next/'
doesn't seem to work, and that is the "official" nextjs template from netlify. Still haven't built locally to understand why.
Run nwtgck/actions-netlify@v3.0
with:
publish-dir: .next/
production-branch: master
github-token: ***
production-deploy: true
deploy-message: Deployed from Action.
enable-commit-comment: false
enable-pull-request-comment: false
overwrites-pull-request-comment: true
enable-github-deployment: false
env:
NETLIFY_SITE_ID: ***
NETLIFY_AUTH_TOKEN: ***
Error: No files or functions to deploy
I'm trying to deploy my app on Netlify, There is no problem during the deploy, but I don't know the right publish-dir to can see my home page.