From 6f53f9dc8eb501fd43d1653a7ed6da098fc850ad Mon Sep 17 00:00:00 2001 From: Jay Wang Date: Mon, 2 Oct 2023 11:53:23 -0400 Subject: [PATCH] Use gh-pages to deploy page Signed-off-by: Jay Wang --- .gitignore | 2 +- deploy-gh-page.sh | 5 +++++ package.json | 4 +++- 3 files changed, 9 insertions(+), 2 deletions(-) create mode 100644 deploy-gh-page.sh diff --git a/.gitignore b/.gitignore index fc4ca392..75f3ff7c 100644 --- a/.gitignore +++ b/.gitignore @@ -8,6 +8,6 @@ public/assets/css/bundle.* *.swp yarn.lock dist/ -deploy-gh-page.sh local-build/ tiny-vgg/data/ +pnpm-lock.yaml \ No newline at end of file diff --git a/deploy-gh-page.sh b/deploy-gh-page.sh new file mode 100644 index 00000000..92f96295 --- /dev/null +++ b/deploy-gh-page.sh @@ -0,0 +1,5 @@ +npm run build +cp -r ./public/assets ./dist +cp -r ./public/bundle* ./dist +cp -r ./public/global.css ./dist +npx gh-pages -m "Deploy $(git log '--format=format:%H' master -1)" -d ./dist \ No newline at end of file diff --git a/package.json b/package.json index eb999fec..570e7251 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,7 @@ "version": "1.0.0", "devDependencies": { "@rollup/plugin-replace": "^2.3.2", + "gh-pages": "^6.0.0", "rollup": "^1.27.13", "rollup-plugin-commonjs": "^10.0.0", "rollup-plugin-livereload": "^1.0.0", @@ -19,6 +20,7 @@ "build": "rollup -c", "dev": "rollup -c -w", "start": "sirv public --single", - "start:dev": "sirv public --single --dev --port 3000" + "start:dev": "sirv public --single --dev --port 3000", + "deploy": "npx" } }