Skip to content

Commit

Permalink
Merge pull request #21 from godatadriven/feature/add-nextjs-app
Browse files Browse the repository at this point in the history
feat: add nextjs app
  • Loading branch information
JCZuurmond committed Aug 25, 2023
2 parents b6bfe63 + d430066 commit 7ebd103
Show file tree
Hide file tree
Showing 17 changed files with 5,330 additions and 7 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/deploy_dashboard.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Deploy Next.js site to Pages

on:
push:
branches: ["main"]
workflow_dispatch:

permissions:
contents: read
pages: write
id-token: write

concurrency:
group: "pages"
cancel-in-progress: false

env:
WORKING_DIRECTORY: ./dashboard

jobs:
build:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ${{ env.WORKING_DIRECTORY }}
steps:
- name: Checkout
uses: actions/checkout@v3

- name: Setup Node
uses: actions/setup-node@v3
with:
node-version: "lts/*"
cache: npm
cache-dependency-path: ${{ env.WORKING_DIRECTORY }}

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Install dependencies
run: npm ci

- name: Build with Next.js
run: npx --no-install next build

- name: Static HTML export with Next.js
run: npx --no-install next export

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
name: github-pages
path: ./${{ env.WORKING_DIRECTORY }}/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
artifact_name: github-pages
uses: actions/deploy-pages@v2
7 changes: 0 additions & 7 deletions .github/workflows/deploy_to_github_pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,14 +54,7 @@ jobs:
- name: Generate site
run: python _site/generate_html.py ${{ env.DUCKDB_PATH }} _site/index.html

- name: Setup Pages
uses: actions/configure-pages@v3

- name: Upload artifact
uses: actions/upload-pages-artifact@v2
with:
path: "_site/"

- name: Deploy to GitHub Pages
id: deployment
uses: actions/deploy-pages@v2
39 changes: 39 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -13,3 +13,42 @@ logs/
# Site
_site/index.html
.idea

### Next.js

# dependencies
/dashboard/node_modules
/dashboard/.pnp
.pnp.js

# testing
/dashboard/coverage

# next.js
/dashboard/.next/
/dashboard/out/

# production
/dashboard/build

# misc
.DS_Store
*.pem

# debug
npm-debug.log*
yarn-debug.log*
yarn-error.log*

# local env files
.env.local
.env.development.local
.env.test.local
.env.production.local

# vercel
.vercel

# typescript
*.tsbuildinfo
next-env.d.ts
7 changes: 7 additions & 0 deletions dashboard/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# Material UI - Next.js Dashboard

This project is based on the [Material UI Dashboard template](https://mui.com/material-ui/getting-started/templates/), used in a project that is based on the [Material UI - Next.js Pages Router](https://github.com/mui/material-ui/tree/master/examples/material-ui-nextjs-pages-router-ts) example.

## Running Locally

To run the app locally, execute `npm install` followed by `npm run dev`.
4 changes: 4 additions & 0 deletions dashboard/next.config.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
/** @type {import('next').NextConfig} */
module.exports = {
reactStrictMode: true,
};
Loading

0 comments on commit 7ebd103

Please sign in to comment.