From 64f0400b139fa518d9de83350bd7d083483d0588 Mon Sep 17 00:00:00 2001 From: Felix Zhang <22125939+fan-zhang-sv@users.noreply.github.com> Date: Thu, 16 Nov 2023 19:33:51 -0800 Subject: [PATCH] GitHub Action: Auto-Deploying master Branch to GitHub Pages (#1069) * build and deploy * missed one import * sort import * clean up yml * removed comments --- .github/workflows/build-and-deploy.yml | 51 ++++++++++++++++++++++++++ apps/testapp/package.json | 3 +- apps/testapp/src/pages/index.tsx | 4 +- 3 files changed, 55 insertions(+), 3 deletions(-) create mode 100644 .github/workflows/build-and-deploy.yml diff --git a/.github/workflows/build-and-deploy.yml b/.github/workflows/build-and-deploy.yml new file mode 100644 index 0000000000..25df3e9680 --- /dev/null +++ b/.github/workflows/build-and-deploy.yml @@ -0,0 +1,51 @@ +name: Deploy Coinbase Wallet SDK Playground to Pages + +on: + push: + branches: ["master"] + + workflow_dispatch: + +permissions: + contents: read + pages: write + id-token: write + +concurrency: + group: "pages" + cancel-in-progress: false + +jobs: + build: + runs-on: ubuntu-latest + steps: + - name: Checkout + uses: actions/checkout@v3 + - name: Setup Node + uses: actions/setup-node@v3 + with: + node-version: "18" + cache: yarn + - name: Setup Pages + uses: actions/configure-pages@v3 + with: + static_site_generator: next + - name: Install dependencies + run: yarn install + - name: Build and export with Next.js + run: yarn workspace @coinbase/wallet-sdk-testapp run export + - name: Upload artifact + uses: actions/upload-pages-artifact@v2 + with: + path: ./apps/testapp/out + + 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@v2 diff --git a/apps/testapp/package.json b/apps/testapp/package.json index c642ae957b..3bd3d73ad9 100644 --- a/apps/testapp/package.json +++ b/apps/testapp/package.json @@ -4,7 +4,8 @@ "scripts": { "dev": "next dev --port 3001", "build": "next build", - "start": "next start" + "start": "next start", + "export": "yarn workspace @coinbase/wallet-sdk run build && next build && next export" }, "dependencies": { "@chakra-ui/icons": "^2.1.1", diff --git a/apps/testapp/src/pages/index.tsx b/apps/testapp/src/pages/index.tsx index f2fcc477c8..651e394394 100644 --- a/apps/testapp/src/pages/index.tsx +++ b/apps/testapp/src/pages/index.tsx @@ -5,7 +5,7 @@ import { EventListenersCard } from '../components/EventListeners/EventListenersC import { WIDTH_2XL } from '../components/Layout'; import { connectionMethods } from '../components/RpcMethods/method/connectionMethods'; import { multiChainMethods } from '../components/RpcMethods/method/multiChainMethods'; -import { RpcMethod } from '../components/RpcMethods/method/RpcRequestInput'; +import { RpcRequestInput } from '../components/RpcMethods/method/RpcRequestInput'; import { sendMethods } from '../components/RpcMethods/method/sendMethods'; import { signMessageMethods } from '../components/RpcMethods/method/signMessageMethods'; import { RpcMethodCard } from '../components/RpcMethods/RpcMethodCard'; @@ -45,7 +45,7 @@ function MethodsSection({ shortcutsMap, }: { title: string; - methods: RpcMethod[]; + methods: RpcRequestInput[]; shortcutsMap?: Record; }) { return (