Skip to content

Commit 3c6a86c

Browse files
author
Fernando Ledesma
committed
add ci workflows
1 parent 5ddf8a4 commit 3c6a86c

3 files changed

Lines changed: 162 additions & 0 deletions

File tree

.github/workflows/ci.yml

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,38 @@
1+
name: CI
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
pull_request:
8+
branches:
9+
- "**"
10+
11+
jobs:
12+
lint-and-build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
matrix:
16+
example: [mdk-nextjs-demo]
17+
steps:
18+
- name: Checkout
19+
uses: actions/checkout@v4
20+
21+
- name: Setup Node.js
22+
uses: actions/setup-node@v4
23+
with:
24+
node-version: 20
25+
cache: npm
26+
cache-dependency-path: ${{ matrix.example }}/package-lock.json
27+
28+
- name: Install dependencies
29+
run: npm ci
30+
working-directory: ${{ matrix.example }}
31+
32+
- name: Lint
33+
run: npm run lint
34+
working-directory: ${{ matrix.example }}
35+
36+
- name: Build
37+
run: npm run build
38+
working-directory: ${{ matrix.example }}

.github/workflows/vercel-demo.yml

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,59 @@
1+
name: Deploy to Vercel
2+
3+
on:
4+
workflow_dispatch:
5+
inputs:
6+
environment:
7+
description: "Vercel environment to pull (preview or production)"
8+
required: false
9+
default: "preview"
10+
pull_request:
11+
branches:
12+
- "**"
13+
push:
14+
branches:
15+
- main
16+
17+
jobs:
18+
deploy:
19+
runs-on: ubuntu-latest
20+
env:
21+
APP_DIR: mdk-nextjs-demo
22+
steps:
23+
- name: Checkout
24+
uses: actions/checkout@v4
25+
26+
- name: Setup Node.js
27+
uses: actions/setup-node@v4
28+
with:
29+
node-version: 20
30+
cache: npm
31+
cache-dependency-path: ${{ env.APP_DIR }}/package-lock.json
32+
33+
- name: Install dependencies
34+
run: npm ci
35+
working-directory: ${{ env.APP_DIR }}
36+
37+
- name: Lint demo
38+
run: npm run lint
39+
working-directory: ${{ env.APP_DIR }}
40+
41+
- name: Build demo
42+
run: npm run build
43+
working-directory: ${{ env.APP_DIR }}
44+
45+
- name: Pull Vercel environment settings
46+
run: npx vercel pull --yes --environment=${{ inputs.environment || 'preview' }} --token=$VERCEL_TOKEN
47+
working-directory: ${{ env.APP_DIR }}
48+
env:
49+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
50+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
51+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}
52+
53+
- name: Deploy to Vercel
54+
run: npx vercel deploy --prod --yes --token=$VERCEL_TOKEN
55+
working-directory: ${{ env.APP_DIR }}
56+
env:
57+
VERCEL_TOKEN: ${{ secrets.VERCEL_TOKEN }}
58+
VERCEL_ORG_ID: ${{ secrets.VERCEL_ORG_ID }}
59+
VERCEL_PROJECT_ID: ${{ secrets.VERCEL_PROJECT_ID }}

README.md

Lines changed: 65 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,65 @@
1+
# Money Dev Kit Examples
2+
3+
This repository contains example applications demonstrating how to integrate Money Dev Kit into your projects. These examples use published npm packages and represent real-world usage patterns.
4+
5+
## Examples
6+
7+
### [mdk-nextjs-demo](./mdk-nextjs-demo)
8+
9+
A Next.js application demonstrating the Money Dev Kit checkout flow integration. This example shows:
10+
- Client-side checkout navigation with `useCheckout` hook
11+
- Hosted checkout page rendering with `<Checkout />` component
12+
- Server-side API route setup
13+
- Next.js configuration with the MDK plugin
14+
15+
**Live Demo:** [https://mdk-nextjs-demo-brown.vercel.app](https://mdk-nextjs-demo-brown.vercel.app)
16+
17+
## Getting Started
18+
19+
Each example is a standalone project with its own dependencies and setup instructions. Navigate to the example directory and follow its README.
20+
21+
```bash
22+
cd mdk-nextjs-demo
23+
npm install
24+
npm run dev
25+
```
26+
27+
## Requirements
28+
29+
- Node.js 20 or later
30+
- npm or pnpm
31+
- Money Dev Kit API credentials (get them at [moneydevkit.com](https://moneydevkit.com) or run `npx @moneydevkit/create`)
32+
33+
## Using Published Packages
34+
35+
All examples in this repository use published versions of Money Dev Kit packages:
36+
- `@moneydevkit/nextjs` - Next.js integration components
37+
- `@moneydevkit/core` - Core Lightning functionality
38+
- `@moneydevkit/create` - CLI for generating credentials
39+
40+
For the latest stable versions:
41+
```bash
42+
npm install @moneydevkit/nextjs
43+
```
44+
45+
For beta releases:
46+
```bash
47+
npm install @moneydevkit/nextjs@beta
48+
```
49+
50+
## Contributing
51+
52+
Want to add a new example? Follow these guidelines:
53+
1. Each example should be in its own directory at the repository root
54+
2. Use published npm packages (not local tarballs)
55+
3. Include a detailed README with setup instructions
56+
4. Add your example to the CI workflow matrix in [.github/workflows/ci.yml](./.github/workflows/ci.yml)
57+
5. Ensure the example builds and runs successfully
58+
59+
## Development & Integration Testing
60+
61+
This repository is for **user-facing examples** with published packages. For integration testing with local development builds, see the [mdk-checkout](https://github.com/moneydevkit/mdk-checkout) repository.
62+
63+
## License
64+
65+
MIT

0 commit comments

Comments
 (0)