diff --git a/.github/workflows/storybook-build.yml b/.github/workflows/storybook-build.yml new file mode 100644 index 0000000000..87a26f9931 --- /dev/null +++ b/.github/workflows/storybook-build.yml @@ -0,0 +1,25 @@ +name: Storybook Build Check + +on: + pull_request: + push: + branches: [main] + +jobs: + storybook-build: + runs-on: ubuntu-latest + steps: + - name: Checkout code + uses: actions/checkout@v4 + + - name: Setup Node + uses: actions/setup-node@v4 + with: + node-version: 20 + cache: 'pnpm' + + - name: Install dependencies + run: pnpm install + + - name: Build Storybook + run: pnpm --filter @coinbase/onchainkit run build-storybook diff --git a/README.md b/README.md index 777cbe7da0..c7df99d441 100644 --- a/README.md +++ b/README.md @@ -139,3 +139,14 @@ Then, you can view the playground at [http://localhost:3000](http://localhost:30 ## 🌊 License This project is licensed under the MIT License - see the [LICENSE.md](LICENSE.md) file for details + +## 🐳 Running with Docker + +You can build and run the project locally using Docker without installing Node.js or pnpm manually. + +```bash +# Build the image +docker build -f tools/docker/Dockerfile -t onchainkit . + +# Run the app +docker run -it --rm -p 3000:3000 onchainkit \ No newline at end of file diff --git a/tools/docker/.dockerignore b/tools/docker/.dockerignore new file mode 100644 index 0000000000..a82aa2f76c --- /dev/null +++ b/tools/docker/.dockerignore @@ -0,0 +1,9 @@ +node_modules +dist +build +.cache +.git +.github +.vscode +*.log +*.tsbuildinfo diff --git a/tools/docker/Dockerfile b/tools/docker/Dockerfile new file mode 100644 index 0000000000..882f2d1959 --- /dev/null +++ b/tools/docker/Dockerfile @@ -0,0 +1,15 @@ +FROM node:20-alpine + +WORKDIR /app + +COPY package.json pnpm-lock.yaml pnpm-workspace.yaml ./ + +RUN npm install -g pnpm + +COPY . . + +RUN pnpm install --frozen-lockfile + +EXPOSE 3000 + +CMD ["pnpm", "--filter", "playground", "dev"]