From 1140d6eaa44a7487f3a2a2d46e7e0fde1eea1d31 Mon Sep 17 00:00:00 2001 From: Nelson Liu Date: Fri, 17 Jun 2022 22:09:28 +0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=91=B7=20add=20deploy=20workflow?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .github/workflows/deploy.yml | 25 +++++++++++++++++++++++++ .nojekyll | 0 CNAME | 1 + package.json | 2 +- svelte.config.js | 16 ++++++++++------ yarn.lock | 7 +++++++ 6 files changed, 44 insertions(+), 7 deletions(-) create mode 100644 .github/workflows/deploy.yml create mode 100644 .nojekyll create mode 100644 CNAME diff --git a/.github/workflows/deploy.yml b/.github/workflows/deploy.yml new file mode 100644 index 0000000..604ee37 --- /dev/null +++ b/.github/workflows/deploy.yml @@ -0,0 +1,25 @@ +name: Build and Deploy + +on: + release: + types: + - published + +jobs: + build-and-deploy: + concurrency: ci-${{ github.ref }} + runs-on: ubuntu-latest + steps: + - name: Checkout 🛎️ + uses: actions/checkout@v3 + + - name: Install and Build 🔧 + run: | + yarn install --frozen-lockfile + yarn run build + + - name: Deploy 🚀 + uses: JamesIves/github-pages-deploy-action@v4.2.5 + with: + branch: gh-pages + folder: build diff --git a/.nojekyll b/.nojekyll new file mode 100644 index 0000000..e69de29 diff --git a/CNAME b/CNAME new file mode 100644 index 0000000..588e055 --- /dev/null +++ b/CNAME @@ -0,0 +1 @@ +inkrosetta.tw diff --git a/package.json b/package.json index 7680eef..f792ce1 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ "lint": "eslint ." }, "devDependencies": { - "@sveltejs/adapter-auto": "next", + "@sveltejs/adapter-static": "^1.0.0-next.34", "@sveltejs/kit": "next", "@typescript-eslint/eslint-plugin": "^5.27.0", "@typescript-eslint/parser": "^5.27.0", diff --git a/svelte.config.js b/svelte.config.js index 788b06f..e5d244c 100644 --- a/svelte.config.js +++ b/svelte.config.js @@ -1,5 +1,5 @@ -import adapter from '@sveltejs/adapter-auto'; -import preprocess from 'svelte-preprocess'; +import adapter from '@sveltejs/adapter-static' +import preprocess from 'svelte-preprocess' import importAssets from 'svelte-preprocess-import-assets' import {vanillaExtractPlugin} from '@vanilla-extract/vite-plugin' @@ -10,7 +10,11 @@ const config = { preprocess: [preprocess(), importAssets()], kit: { - adapter: adapter(), + adapter: adapter({ + pages: 'build', + assets: 'build', + fallback: null, + }), prerender: { default: true, @@ -29,7 +33,7 @@ const config = { noExternal: ['@vanilla-extract/css', '@vanilla-extract/sprinkles', '@vanilla-extract/css/fileScope'], }, }, - } -}; + }, +} -export default config; +export default config diff --git a/yarn.lock b/yarn.lock index 70100ae..0917230 100644 --- a/yarn.lock +++ b/yarn.lock @@ -149,6 +149,13 @@ set-cookie-parser "^2.4.8" tiny-glob "^0.2.9" +"@sveltejs/adapter-static@^1.0.0-next.34": + version "1.0.0-next.34" + resolved "https://registry.yarnpkg.com/@sveltejs/adapter-static/-/adapter-static-1.0.0-next.34.tgz#f17e967e43f73e57feed6d81d8151de1e09d9836" + integrity sha512-XjuMhemme5z0L/B2nTZpA6k+RJjF+b6L96ts6gIQ6ixiCzJQSbBqJhrrBYBCaeLAKvdUMoGEmX8m862JhKjRFg== + dependencies: + tiny-glob "^0.2.9" + "@sveltejs/adapter-vercel@1.0.0-next.58": version "1.0.0-next.58" resolved "https://registry.yarnpkg.com/@sveltejs/adapter-vercel/-/adapter-vercel-1.0.0-next.58.tgz#1ccd0cb464984f5bd59d700a91bedae93a35e70e"