nwtgck / actions-netlify

🚀 Netlify deploy from GitHub Actions
MIT License
326 stars 41 forks source link

Page Not Found for Remix + Vite App #1155

Open krlakwa opened 5 months ago

krlakwa commented 5 months ago

I'm trying to deploy my Remix + Vite app but I can see only Page not found on Netlify. It occurs only when I'm trying to deploy using Github Actions, it works fine when I enable automatic deploy on Netlify. Has anyone struggle with similar issue? Here's like my config files look like: deploy.yml

name: Deploy

on:
  workflow_dispatch:

jobs:
  app-setup:
    runs-on: ubuntu-latest
    steps:
      - name: Configure AWS CLI
        uses: aws-actions/configure-aws-credentials@v2
        with:
          aws-region: eu-central-1
          aws-access-key-id: ${{ secrets.AWS_ACCESS_KEY_ID }}
          aws-secret-access-key: ${{ secrets.AWS_SECRET_ACCESS_KEY }}

      - name: Checkout repository
        uses: actions/checkout@v4

      - name: Login to AWS CodeArtifact
        run: |
            aws codeartifact login --tool npm --repository ${{ secrets.AWS_CODEARTIFACT_REPOSITORY }} --domain ${{ secrets.AWS_CODEARTIFACT_DOMAIN }} --domain-owner ${{ secrets.AWS_CODEARTIFACT_DOMAIN_OWNER }}

      - name: Configure node
        uses: actions/setup-node@v4
        with:
          node-version-file: ".nvmrc"

      - name: Install dependencies
        run: npm ci

      - name: Build
        run: npm run build

      - name: Deploy to Netlify
        uses: nwtgck/actions-netlify@v3.0
        with:
          publish-dir: "./build/client"
          production-branch: master
          github-token: ${{ secrets.GITHUB_TOKEN }}
          deploy-message: "Deployed from GitHub Actions"
          functions-dir: ".netlify/functions-internal"
          netlify-config-path: 'netlify.toml'

        env:
          NETLIFY_AUTH_TOKEN: ${{ secrets.NETLIFY_AUTH_TOKEN }}
          NETLIFY_SITE_ID: ${{ secrets.NETLIFY_SITE_ID }}

netlify.toml

[build]
command = "npm run build"
publish = "build/client"

[dev]
command = "npm run dev"
framework = "vite"
nwtgck commented 5 months ago

The result of adding find ... command may be useful for debugging:

- name: Build
   run: npm run build
# Added for debug
- run: find . -depth 2 | grep -v node_modules | grep -v .git
- ...
braincomb commented 3 months ago

@krlakwa is your site SSR? I noticed you are deploying functions.

I'm currently struggling with a similar issue where deploying functions-dir doesn't quite work as expected, I can see the function being picked up by Netlify but still seeing Page Not Found. When I do netlify deploy manually, everything works.