From f309fdb5a69879049e9f7c74fc84a5b8df8f4cfa Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Tue, 22 Mar 2022 02:41:12 +0600 Subject: [PATCH 1/4] Remove manual deploy scripts --- package.json | 2 -- 1 file changed, 2 deletions(-) diff --git a/package.json b/package.json index cfeb00a..60193ae 100644 --- a/package.json +++ b/package.json @@ -14,8 +14,6 @@ "dev": "vite", "build": "vite build", "preview": "vite preview", - "predeploy": "npm run build", - "deploy": "gh-pages -d build", "lint": "eslint --ext .js,.jsx .", "lint:fix": "eslint --ext .js,.jsx --fix .", "prettier": "prettier --check './**/*.{js,jsx,ts,tsx,css,md,json}' --config ./.prettierrc", From ebc01a51f9bc36fba4571c20b08ab8a953527666 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Tue, 22 Mar 2022 02:41:29 +0600 Subject: [PATCH 2/4] Remove homepage --- package.json | 1 - 1 file changed, 1 deletion(-) diff --git a/package.json b/package.json index 60193ae..d7f2162 100644 --- a/package.json +++ b/package.json @@ -3,7 +3,6 @@ "description": "Kickstart your personal portfolio with Github Api and blog", "private": true, "version": "2.0.0", - "homepage": "https://arifszn.github.io/gitprofile", "license": "Apache-2.0", "author": "arifszn", "repository": { From 741e8ff6cdb9914909669af0c05b6c1b869b4ea0 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Tue, 22 Mar 2022 02:50:29 +0600 Subject: [PATCH 3/4] Add instruction for base value in vite.config.js --- vite.config.js | 2 ++ 1 file changed, 2 insertions(+) diff --git a/vite.config.js b/vite.config.js index 62db4ef..fc4198e 100644 --- a/vite.config.js +++ b/vite.config.js @@ -3,6 +3,8 @@ import react from '@vitejs/plugin-react'; // https://vitejs.dev/config/ export default defineConfig({ + // If you are deploying to https://.github.io/, set base to '/'. + // If you are deploying to https://.github.io//, for example your repository is at https://github.com//, then set base to '//'. base: '/gitprofile/', plugins: [react()], }); From 7f007a8bb06bdc356c62a782d594bdfe5f2bfec9 Mon Sep 17 00:00:00 2001 From: Ariful Alam Date: Tue, 22 Mar 2022 02:54:37 +0600 Subject: [PATCH 4/4] Update guide for deployment --- README.md | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 80832ed..a0d30d0 100644 --- a/README.md +++ b/README.md @@ -46,13 +46,17 @@ These instructions will get you a copy of the project and deploy your website on ![Workflows](https://arifszn.github.io/assets/img/hosted/gitprofile/workflows.png) -- Open `package.json`, and change `homepage`'s value to `https://username.github.io`. +- Open `vite.config.js`, and change `base`'s value. + + - If you are deploying to `https://.github.io/`, set `base` to `'/'`. + + - If you are deploying to `https://.github.io//`, for example your repository is at `https://github.com//`, then set `base` to `'//'`. ```js - // package.json + // vite.config.js { + base: '/', // ... - "homepage": "https://username.github.io", } ``` @@ -62,11 +66,9 @@ These instructions will get you a copy of the project and deploy your website on - Your personal portfolio will be live at `username.github.io`. - Any time you commit a change to the **main** branch, the website will be automatically updated. -You can skip the above steps and do a manual deployment by running `npm run deploy`. For more info, visit [here](https://create-react-app.dev/docs/deployment/#github-pages). +If you see only `README` at `username.github.io`, be sure to change your GitHub Page's source to `gh-pages` branch. See [how to](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site). Also, if you face any issue rendering the website, double-check the `base` value in the `vite.config.js`. -If you see only `README` at `username.github.io`, be sure to change your GitHub Page's source to `gh-pages` branch. See [how to](https://docs.github.com/en/pages/getting-started-with-github-pages/configuring-a-publishing-source-for-your-github-pages-site). Also, if you face any issue rendering the website, double-check the `homepage` value in the `package.json`. It must be the value matching the repository name. - -As this is a create react app, you can also host your website to Netlify, Vercel, Heroku, or other popular services. Please refer to this [doc](https://create-react-app.dev/docs/deployment) for a detailed deployment guide to other services. +As this is a vite project, you can also host your website to Netlify, Vercel, Heroku, or other popular services. Please refer to this [doc](https://vitejs.dev/guide/static-deploy.html) for a detailed deployment guide to other services. ## 🎨 Customization