From fe65b4954344d558bf0d987be312ab35418c1a40 Mon Sep 17 00:00:00 2001 From: Stim Fry Mac Date: Wed, 7 Feb 2024 19:42:02 +0000 Subject: [PATCH] Deploying site --- deploy.sh | 28 ++++++++++++++++++++++++++++ package.json | 3 ++- vite.config.js | 1 + 3 files changed, 31 insertions(+), 1 deletion(-) create mode 100644 deploy.sh diff --git a/deploy.sh b/deploy.sh new file mode 100644 index 0000000..cf87544 --- /dev/null +++ b/deploy.sh @@ -0,0 +1,28 @@ +#!/usr/bin/env sh +# abort on errors +set -e + +# build +npm run build + +# navigate into the build output directory +cd dist + +# place .nojekyll to bypass Jekyll processing +echo > .nojekyll + +# if you are deploying to a custom domain +# echo 'www.example.com' > CNAME + +git init +git checkout -B main +git add -A +git commit -m 'deploy' + +# if you are deploying to https://.github.io +# git push -f git@github.com:/.github.io.git main + +# if you are deploying to https://.github.io/ +# git push -f git@github.com:/.git main:gh-pages + +cd - \ No newline at end of file diff --git a/package.json b/package.json index 2546681..b2c49fc 100644 --- a/package.json +++ b/package.json @@ -7,7 +7,8 @@ "dev": "vite", "build": "vite build", "lint": "eslint . --ext js,jsx --report-unused-disable-directives --max-warnings 0", - "preview": "vite preview" + "preview": "vite preview", + "deploy": "gh-pages -d dist" }, "dependencies": { "@heroicons/react": "^2.1.1", diff --git a/vite.config.js b/vite.config.js index 244decf..20182f4 100644 --- a/vite.config.js +++ b/vite.config.js @@ -32,4 +32,5 @@ export default defineConfig({ open: true, port: 3000 }, + base: '/portfolio-react/', }) \ No newline at end of file