Question

Website deployed from GitHub using the 'Apps' function not detecting css folder.

Hey Team,

I just got started with Digital Ocean and I’m using it to host my portfolio website. I used the ‘Apps’ feature to deploy my GitHub repo and it deployed everything successfully, however I have my CSS files in a CSS folder, for some reason it’s not loading that folder or the css files. When I move the style.css file into the root folder it loads it.

Is there something I am missing or is there a way to fix this that anyone is aware of?

You can see my portfolio site here https://danagnew.co.nz

Cheers, Dan A


Submit an answer


This textbox defaults to using Markdown to format your answer.

You can type !ref in this text area to quickly search our full set of tutorials, documentation & marketplace offerings and insert the link!

Sign In or Sign Up to Answer

These answers are provided by our Community. If you find them useful, show some love by clicking the heart. If you run into issues leave a comment, or add your own answer to help others.

Bobby Iliev
Site Moderator
Site Moderator badge
December 23, 2023

Hey Dan,

First off, congrats on getting your portfolio website up and running with DigitalOcean’s App Platform! It’s great that you’ve successfully deployed your site! Let’s try and troubleshoot the CSS issue, here are the first things that I would recommend checking:

  1. Double-check the path to your CSS files in your HTML. If your CSS files are in a CSS folder, the link in your HTML should look something like this:

    <link rel="stylesheet" href="/css/style.css">
    

    Make sure the path correctly reflects the folder structure in your GitHub repo.

  2. Paths on servers are often case-sensitive. If your folder is named CSS but your HTML is referencing css, it won’t find the files. Ensure that the case matches exactly.

  3. Use your browser’s developer tools to check the network requests for your CSS files. This can give you clues as to whether the files are not found (404 errors) or if there’s another issue.

  4. In the DigitalOcean App Platform, check your build and publish settings. Make sure that the publish directory is set correctly to include your CSS folder. Sometimes, if the publish directory is set to the root, it may not include subdirectories by default.

  5. Verify that your GitHub repository’s structure is as you expect and that the CSS folder is not in a .gitignore file or excluded in some other way.

  6. If you’re using relative paths, try switching to absolute paths (or vice versa) to see if that resolves the issue. Sometimes path resolution can behave differently in a deployed environment versus a local environment.

After making changes, re-deploy your app. Sometimes, a simple re-deployment can fix path issues.

Best of luck, Dan! Let me know how it goes!

Best,

Bobby

Try DigitalOcean for free

Click below to sign up and get $200 of credit to try our products over 60 days!

Sign up

Featured on Community

Get our biweekly newsletter

Sign up for Infrastructure as a Newsletter.

Hollie's Hub for Good

Working on improving health and education, reducing inequality, and spurring economic growth? We'd like to help.

Become a contributor

Get paid to write technical tutorials and select a tech-focused charity to receive a matching donation.

Welcome to the developer cloud

DigitalOcean makes it simple to launch in the cloud and scale up as you grow — whether you're running one virtual machine or ten thousand.

Learn more
DigitalOcean Cloud Control Panel