How to deploy a folder inside a repository in GitHub

Hi everybody. I’have deployed my app ( https://sparkling-daffodil-439c8a.netlify.app) but there is nothing. I want to deploy a folder inside a repository in GitHub, not the whole repository. What can I do? Thaks in avdance. Regards.

  • we need to know your netlify site name. Example: gifted-antelope-58b104.netlify.app
  • DNS issues? Tell us the custom domain, tell us the error message! We can’t help if we don’t know your domain.
  • Build problems? Link or paste the FULL build log & build settings screenshot

The better the post - the faster the answer.

Hey there, @Amapola-Negra :wave:

Thanks so much for reaching out. Can you elaborate a bit more about your use case? What folder do you wish to deploy? Can you share your repo with us?

hi Hillary. Thank you very much for your reply. Yes. my repository is GitHub - Amapola-Negra/freeCodeCamp-Projects-Repo

I’m trying to deploy an app wich is inside the folder “Random-Quote-Machine”. It is a React app, so I think I have to reach the folder “public” inside the other folder. Thanks in advance.

Regards

Try going here: Netlify App and change the build settings to:

  1. Base path: Random-Quote-Machine
  2. Build command: CI= npm run build
  3. Publish directory: build.

Inside the public folder, also add a file named _redirects with the value:

/* /index.html 200

Hi. Thanks for all your time, but it doesn’t work.

Regards

What do you mean by it doesn’t work? Do you get an error?

Hi. Well. I doesn’t get an error. I get nothing, just a white screen. My app in not there. Thanks in advance.

That’s because your HTML file is not referencing any JavaScript assets:


<!DOCTYPE html>
<html lang="en">
    <head>
        <meta charset="UTF-8">
        <meta name="viewport" content="width=device-width, initial-scale=1.0">
        <link rel="preconnect" href="https://fonts.googleapis.com">
        <link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
        <link href="https://fonts.googleapis.com/css2?family=Raleway:ital,wght@1,300;1,600&display=swap" rel="stylesheet"> 
                <link rel="stylesheet" href="style.css">

        <title>Random Quotes Machine</title>
    </head>
    <body>
        <div id="app"></div>
    </body>
</html>

That’s the entire HTML that you’ve built for your site. Since there is no JavaScript file being loaded, React never loads and parses the DOM.

Try building locally (npm run build NOT npm run start) and see what you’re getting in your build/index.html file.