From f26e20e5cf57d1194e67971f5df968c2be441844 Mon Sep 17 00:00:00 2001 From: Sourabh Kumar Ravi <66831910+SourabhRavi@users.noreply.github.com> Date: Sat, 5 Nov 2022 01:24:52 +0530 Subject: [PATCH] add steps for deployment to GitHub Pages and also fix for any errors --- README.md | 77 +++++++++++++++++++++++++++++++++++++++++++++---------- 1 file changed, 63 insertions(+), 14 deletions(-) diff --git a/README.md b/README.md index 990c3f027f..fefa007a04 100644 --- a/README.md +++ b/README.md @@ -33,46 +33,95 @@ Please also note that I did not build this site with the intention of it being a Yes, you can fork this repo. Please give me proper credit by linking back to [brittanychiang.com](https://brittanychiang.com). Thanks! -## 🛠 Installation & Set Up -1. Install the Gatsby CLI +# Steps to push to deployment + +1. open git bash in your current project directory and use ```sh - npm install -g gatsby-cli + source ~/.nvm/nvm.sh ``` -2. Install and use the correct version of Node using [NVM](https://github.com/nvm-sh/nvm) +2. nvm install node (version 16); ```sh - nvm install + nvm install 16 ``` -3. Install dependencies +3. if nvm isn't installed, install it first ```sh - yarn + curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.2/install.sh | bash + ``` + +4. incase of any errors with graph-ql or anything, read the error log properly and if needed, use --legacy-peer-deps after any install command + + ```sh + npm install --legacy-peer-deps ``` -4. Start the development server +5. Install yarn ```sh - npm start + npm install -g yarn ``` -## 🚀 Building and Running for Production +6. Install dependencies -1. Generate a full static production build + ```sh + yarn + ``` + +7. Install Gatsby CLI ```sh - npm run build + npm install -g gatsby-cli ``` -1. Preview the site as it will appear once deployed +8. Install dependencies ```sh - npm run serve + npm install ``` +9. Install GitHub Pages + + [Remember: if any error and if needed, use --legacy-peer-deps with install command] + + ```sh + npm install gh-pages + ``` + +10. Add changes in the working directory to the staging area + + ```sh + git add + ``` + +11. Commit + + ```sh + git commit -am "changes" + ``` + +12. Generate a full static production build + + ```sh + gatsby build + ``` + +13. Preview the site as it will appear once deployed + + ```sh + npm run serve + ``` + +14. Deploy + + ```sh + npm run deploy + ``` + ## 🎨 Color Reference | Color | Hex |