From cea5b953ee832391a3c3e892276385ac382a6713 Mon Sep 17 00:00:00 2001 From: hade Date: Sun, 24 Nov 2024 01:10:18 +0700 Subject: [PATCH] add CI --- .github/workflows/main.yaml | 72 +++++++++++++++++++++++++++++++++++++ next.config.js | 3 +- 2 files changed, 74 insertions(+), 1 deletion(-) create mode 100644 .github/workflows/main.yaml diff --git a/.github/workflows/main.yaml b/.github/workflows/main.yaml new file mode 100644 index 0000000..277826a --- /dev/null +++ b/.github/workflows/main.yaml @@ -0,0 +1,72 @@ +on: + push: + branches: ["main"] + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +# Allow only one concurrent deployment, skipping runs queued between the run in-progress and latest queued. +# However, do NOT cancel in-progress runs as we want to allow these production deployments to complete. +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + # Build job + build: + runs-on: ubuntu-latest + + steps: + - name: Checkout + uses: actions/checkout@v4 + + - name: Install Node.js + uses: actions/setup-node@v4 + with: + node-version: 20 + + - uses: pnpm/action-setup@v3 + name: Install pnpm + with: + version: 8 + run_install: false + + - name: Get pnpm store directory + shell: bash + run: | + echo "STORE_PATH=$(pnpm store path --silent)" >> $GITHUB_ENV + + - uses: actions/cache@v4 + name: Setup pnpm cache + with: + path: ${{ env.STORE_PATH }} + key: ${{ runner.os }}-pnpm-store-${{ hashFiles('**/pnpm-lock.yaml') }} + restore-keys: | + ${{ runner.os }}-pnpm-store- + + - name: Install dependencies + run: pnpm install + + - name: Build + run: | + pnpm build + + - name: Upload artifact + uses: actions/upload-pages-artifact@v3 + with: + path: ./out + + # Deployment job + deploy: + environment: + name: github-pages + url: ${{ steps.deployment.outputs.page_url }} + runs-on: ubuntu-latest + needs: build + steps: + - name: Deploy to GitHub Pages + id: deployment + uses: actions/deploy-pages@v4 diff --git a/next.config.js b/next.config.js index 5a2797a..abe091b 100644 --- a/next.config.js +++ b/next.config.js @@ -1,8 +1,9 @@ /** @type {import('next').NextConfig} */ const nextConfig = { - output: 'standalone', + output: 'export', reactStrictMode: true, + basePath: "/money-kit-ui", webpack: (config) => { config.experiments = { asyncWebAssembly: true,