From badcb58aa47e116e34fef9a916d4d9df5f55ca0c Mon Sep 17 00:00:00 2001 From: Ignacio Date: Tue, 27 Feb 2024 15:58:08 +0800 Subject: [PATCH] feat: add back gh-pages --- .github/workflows/check.yml | 1 - .github/workflows/gh-pages.yml | 37 +++++++++++++++++++++++++++ next.config.mjs | 20 ++++++++++----- src/features/staking/lib/constants.ts | 10 +++++--- 4 files changed, 57 insertions(+), 11 deletions(-) create mode 100644 .github/workflows/gh-pages.yml diff --git a/.github/workflows/check.yml b/.github/workflows/check.yml index 1d4294a..945a838 100644 --- a/.github/workflows/check.yml +++ b/.github/workflows/check.yml @@ -1,5 +1,4 @@ name: Test -on: push jobs: Lint: runs-on: ubuntu-latest diff --git a/.github/workflows/gh-pages.yml b/.github/workflows/gh-pages.yml new file mode 100644 index 0000000..b8f085a --- /dev/null +++ b/.github/workflows/gh-pages.yml @@ -0,0 +1,37 @@ +name: GitHub Pages + +on: + workflow_run: + workflows: ["Test"] + types: [completed] + branches: + - "main" + +jobs: + deploy: + runs-on: ubuntu-22.04 + if: ${{ github.event.workflow_run.conclusion == 'success' }} + permissions: + contents: write + concurrency: + group: ${{ github.workflow }}-${{ github.ref }} + steps: + - uses: actions/checkout@v3 + with: + submodules: true # Fetch Hugo themes (true OR recursive) + fetch-depth: 0 # Fetch all history for .GitInfo and .Lastmod + + - uses: actions/setup-node@v4 + with: + node-version: 20 + + - name: Build + run: | + npm i + npm run build + + - name: Deploy + uses: peaceiris/actions-gh-pages@v3 + with: + github_token: ${{ secrets.GITHUB_TOKEN }} + publish_dir: ./out diff --git a/next.config.mjs b/next.config.mjs index deba258..1b204fc 100644 --- a/next.config.mjs +++ b/next.config.mjs @@ -1,16 +1,24 @@ +const useProxy = false; + const nextConfig = { eslint: { ignoreDuringBuilds: process.env.QUICK_BUILD === "true", }, - rewrites: async () => [ - { - destination: "https://rpc.xion-testnet-1.burnt.com:443", - source: "/rpc", - }, - ], typescript: { ignoreBuildErrors: process.env.QUICK_BUILD === "true", }, + ...(useProxy + ? { + rewrites: async () => [ + { + destination: "https://rpc.xion-testnet-1.burnt.com:443", + source: "/rpc", + }, + ], + } + : { + output: "export", + }), }; export default nextConfig; diff --git a/src/features/staking/lib/constants.ts b/src/features/staking/lib/constants.ts index 91b1ad4..53b88cb 100644 --- a/src/features/staking/lib/constants.ts +++ b/src/features/staking/lib/constants.ts @@ -5,7 +5,9 @@ export const { chainId } = testnetChainInfo; export const dashboardUrl = process.env.NODE_ENV === "production" ? undefined : "http://localhost:3000"; -export const rpcEndpoint = - typeof window === "undefined" - ? "https://rpc.xion-testnet-1.burnt.com:443" - : `${window.location.origin}/rpc`; +// export const rpcEndpoint = +// typeof window === "undefined" +// ? "https://rpc.xion-testnet-1.burnt.com:443" +// : `${window.location.origin}/rpc`; + +export const rpcEndpoint = "https://rpc.xion-testnet-1.burnt.com:443";