Skip to content

Commit

Permalink
GitHub Action: Auto-Deploying master Branch to GitHub Pages (#1069)
Browse files Browse the repository at this point in the history
* build and deploy

* missed one import

* sort import

* clean up yml

* removed comments
  • Loading branch information
fan-zhang-sv authored Nov 17, 2023
1 parent f121356 commit 2a53520
Show file tree
Hide file tree
Showing 3 changed files with 55 additions and 3 deletions.
51 changes: 51 additions & 0 deletions .github/workflows/build-and-deploy.yml
Original file line number Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion apps/testapp/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
4 changes: 2 additions & 2 deletions apps/testapp/src/pages/index.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down Expand Up @@ -45,7 +45,7 @@ function MethodsSection({
shortcutsMap,
}: {
title: string;
methods: RpcMethod[];
methods: RpcRequestInput[];
shortcutsMap?: Record<string, ShortcutType[]>;
}) {
return (
Expand Down

0 comments on commit 2a53520

Please sign in to comment.