From 507e557e7b649856501924df0320c2e13860f751 Mon Sep 17 00:00:00 2001 From: infiniteltd Date: Tue, 3 Oct 2023 14:51:33 +0100 Subject: [PATCH] fixes: documentation for deploying to Netlify #62 --- .gitignore | 3 +++ README.md | 30 +++++++++++++++++++++++++++++- netlify.toml | 21 +++++++++++++++++++++ 3 files changed, 53 insertions(+), 1 deletion(-) create mode 100644 netlify.toml diff --git a/.gitignore b/.gitignore index a547bf3..c3bb0db 100644 --- a/.gitignore +++ b/.gitignore @@ -22,3 +22,6 @@ dist-ssr *.njsproj *.sln *.sw? + +# Local Netlify folder +.netlify diff --git a/README.md b/README.md index 3462419..a4e0f4a 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ A portfolio site template that looks and feels like a terminal. -Production: https://my-terminal-portfolio.vercel.app/ +Production: ## Installation @@ -89,6 +89,34 @@ vercel 7. Once the deployment is complete, your terminal-portfolio will be live on Vercel, and Vercel Analytics will be enabled by default, providing you with valuable insights into your website's performance. +## Deploying to Netlify + +Deploying to Netlify can also be a great idea. Considering the fact that they are a large web hosting server as compared to vercel. For deploying to Netlify, we can use two main approaches and we will discuss them in detail. + +### Deploying to Netlify through the CLI + +1. Bear in my mind that this project is using Vite framework. To make sure you are using the latest Netlify CLI, run the following command in the project terminal: + `bash npm install netlify-cli -g` + +2. Next, in the directory of your project, run the following command to create a new file on Netlify: + `bash netlify init` + +3. In case you are new to Netlify, you will be redirected to create a profile on the platform or you can use your github profile to connect to the platform. + +4. Once netlify is initialized, follow the prompts carefully, select the team option if necessary and then optionally personalize the site name if any. + +5. Go back to the netlify platform on the browser and reload the page. + +### Optionally deploying to Netlify through GitHub + +1. Upload your project source code to your github profile. + +2. Go to [netlify](netlify.com) and sign up to the platform using your github profile. + +3. On your netlify page, go to add new site option and select the import an existing project. + +4. Follow the prompts and your project is hosted by netlify. Optionally, you can customize the site if you want. + ## Contributing [Contributing Guide](CONTRIBUTING.md) diff --git a/netlify.toml b/netlify.toml new file mode 100644 index 0000000..ecfc1d0 --- /dev/null +++ b/netlify.toml @@ -0,0 +1,21 @@ +# example netlify.toml +[build] + command = "vite build" + functions = "netlify/functions" + publish = "dist" + + ## Uncomment to use this redirect for Single Page Applications like create-react-app. + ## Not needed for static site generators. + #[[redirects]] + # from = "/*" + # to = "/index.html" + # status = 200 + + ## (optional) Settings for Netlify Dev + ## https://github.com/netlify/cli/blob/main/docs/netlify-dev.md#project-detection + #[dev] + # command = "yarn start" # Command to start your dev server + # port = 3000 # Port that the dev server will be listening on + # publish = "dist" # Folder with the static content for _redirect file + + ## more info on configuring this file: https://docs.netlify.com/configure-builds/file-based-configuration/