Deploy to Netlify
This page teaches you how to deploy Finance App to Netlify using your GitHub account. You do not need any deployment experience.
By the end of this page, you will have:
- A Netlify account
- Your Finance App project connected to Netlify
- A live website accessible from a public URL
What Is Netlify?
Section titled “What Is Netlify?”Netlify is a hosting platform for static websites. It connects directly to your GitHub repository. Every time you push new code to GitHub, Netlify rebuilds and republishes your site automatically.
This means you never have to upload files manually. Change a file, push to GitHub, and your site updates.
Before You Start
Section titled “Before You Start”Make sure you have:
- A GitHub account with your Finance App project already pushed (see the previous page)
- A browser
- About 10 minutes
You do not need a credit card. Netlify has a free tier that is enough for most projects.
Step 1 — Create a Netlify Account
Section titled “Step 1 — Create a Netlify Account”- Open your browser and go to:
https://app.netlify.com/signup- Choose GitHub as your sign-up method. This is the easiest option because it links your GitHub account automatically.
- If asked, authorize Netlify to access your GitHub account.
- Your Netlify account is now created.
Step 2 — Add a New Site
Section titled “Step 2 — Add a New Site”- After signing up, you will see the Netlify dashboard
- Click Add new site → Import an existing project
- Choose Deploy with GitHub
- Authorize Netlify if prompted
- You will see a list of your GitHub repositories
- Find your Finance App repository and click it
Step 3 — Configure the Build
Section titled “Step 3 — Configure the Build”Fill in the form with these values:
| Field | What to Enter |
|---|---|
| Branch to deploy | main |
| Base directory | Leave empty |
| Build command | npm run build |
| Publish directory | dist |
Leave Functions directory empty.
If asked for environment variables, skip this step. Finance App does not require any.
Step 4 — Deploy
Section titled “Step 4 — Deploy”- Click Deploy site
- Netlify will start building your site
- Wait for the build to finish. This usually takes 1 to 3 minutes.
- When the build succeeds, you will see a URL like:
https://random-name-12345.netlify.app- Click the URL to open your live site
Your website is now live on the internet.
Step 5 — Rename the Site (Optional)
Section titled “Step 5 — Rename the Site (Optional)”By default, Netlify gives your site a random name. You can change it:
- In the Netlify dashboard, open your site
- Click Site configuration
- Click Change site name
- Enter your own name, like
finance-app-yourname - Click Save
Your site URL becomes:
https://your-chosen-name.netlify.appStep 6 — Automatic Updates
Section titled “Step 6 — Automatic Updates”After this setup, Netlify watches your GitHub repository. Every time you push new code:
- Netlify detects the change
- It rebuilds the site automatically
- It republishes the updated version
You do not need to do anything else. Just push your changes to GitHub.
How to Update Content Later
Section titled “How to Update Content Later”When you want to change text, images, or posts:
- Edit the JSON or Markdown files in your project folder
- Open a terminal in the project folder
- Run:
git add .git commit -m "Update content"git push- Wait 1 to 3 minutes
- Refresh your live site to see the changes
Optional — Add a Custom Domain
Section titled “Optional — Add a Custom Domain”By default, your site uses a .netlify.app address. If you want to use your own domain, like yourdomain.com:
- In Netlify, open your site
- Click Domain management
- Click Add a domain
- Enter your domain name
- Follow the on-screen instructions to update your DNS records
- Wait for the DNS to propagate. This can take a few minutes to a few hours.
After adding a custom domain, update the site field in astro.config.mjs to match, then push the change.
Common Mistakes
Section titled “Common Mistakes”| Mistake | What Happens | Fix |
|---|---|---|
| Wrong publish directory | Site shows 404 or blank page | Use dist |
| Wrong build command | Build fails | Use npm run build |
| Did not push to GitHub | Netlify cannot find the code | Push your project first |
| Node.js version too old | Build fails with an error | In Netlify site settings, set Node.js version to 18 or higher |
| Base directory set incorrectly | Build fails | Leave base directory empty |
Troubleshooting
Section titled “Troubleshooting”| Problem | Solution |
|---|---|
| Build fails with “command not found” | Make sure package.json has a build script. Check Netlify’s build log for the exact error. |
| Build succeeds but site is blank | Check that the publish directory is dist |
| Changes do not appear after push | Check the Netlify dashboard. If the build failed, open the log and fix the error. |
| Cannot find the repo in Netlify | In GitHub, go to Settings → Applications → Netlify, and grant access to the repository |
| Build times out | Your project may be too large for the free tier. Try building locally first with npm run build |
| Redirect loop on custom domain | Check your DNS settings. Make sure the domain points to Netlify correctly. |
Next Step
Section titled “Next Step”After deploying to Netlify, you can deploy the same project to other platforms, or move on to configuring your custom domain.