Skip to content

Commit

Permalink
Build Improvements (#80)
Browse files Browse the repository at this point in the history
  • Loading branch information
nicholeuf authored May 7, 2024
1 parent b459903 commit c7d725a
Show file tree
Hide file tree
Showing 16 changed files with 6,979 additions and 8,025 deletions.
10 changes: 10 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# add git-ignore syntax here of things you don't want copied into docker image
.git
coverage
*Dockerfile*
node_modules
.env*
.vscode
.editorconfig
.prettierrc
.prettierignore
8 changes: 4 additions & 4 deletions .github/workflows/meticulous.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -39,16 +39,16 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
- run: yarn install --immutable
cache: 'pnpm'
- run: pnpm install

- name: Build project
env:
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME: ${{ secrets.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXT_PUBLIC_GOOGLE_AUTHENTICATION: ${{ secrets.NEXT_PUBLIC_GOOGLE_AUTHENTICATION }}
NEXT_PUBLIC_SMALLCHAT_ENABLED: ${{ secrets.NEXT_PUBLIC_SMALLCHAT_ENABLED }}
run: yarn build
run: pnpm run build

- name: Serve project
# TODO: Update these commands to serve your app's frontend locally, and
Expand All @@ -63,7 +63,7 @@ jobs:
# 2. The sleep is often required to ensure your app is readily being served
# by the time the Meticulous tests start
run: |
yarn start &
pnpm run start &
sleep 5
- name: Run Meticulous tests
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/workflow.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -14,15 +14,15 @@ jobs:
uses: actions/setup-node@v4
with:
node-version: '18.x'
cache: 'yarn'
- run: yarn install --immutable
cache: 'pnpm'
- run: pnpm install
- name: Run Tests
env:
NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME: ${{ secrets.NEXT_PUBLIC_CLOUDINARY_CLOUD_NAME }}
NEXT_PUBLIC_SITE_URL: ${{ secrets.NEXT_PUBLIC_SITE_URL }}
NEXT_PUBLIC_GOOGLE_AUTHENTICATION: ${{ secrets.NEXT_PUBLIC_GOOGLE_AUTHENTICATION }}
NEXT_PUBLIC_SMALLCHAT_ENABLED: ${{ secrets.NEXT_PUBLIC_SMALLCHAT_ENABLED }}
run: yarn test
run: pnpm run test
- name: Upload coverage reports to Codecov
uses: codecov/codecov-action@v4
with:
Expand Down
8 changes: 4 additions & 4 deletions .vscode/launch.json
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
"name": "Next.js: debug server-side",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev"
"command": "pnpm run dev"
},
{
"name": "Next.js: debug client-side",
Expand All @@ -17,7 +17,7 @@
"name": "Next.js: debug full stack",
"type": "node-terminal",
"request": "launch",
"command": "yarn dev",
"command": "pnpm run dev",
"serverReadyAction": {
"pattern": "- Local:.+(https?://.+)",
"uriFormat": "%s",
Expand All @@ -28,13 +28,13 @@
"name": "Next.js: tests",
"type": "node-terminal",
"request": "launch",
"command": "yarn test"
"command": "pnpm run test"
},
{
"name": "Next.js: watch tests",
"type": "node-terminal",
"request": "launch",
"command": "yarn test:watch"
"command": "pnpm run test:watch"
}
]
}
5 changes: 3 additions & 2 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
"**/.pnp.*": true
},
"eslint.nodePath": ".yarn/sdks",
"prettier.prettierPath": ".yarn/sdks/prettier/index.cjs",
"typescript.enablePromptUseWorkspaceTsdk": true
"prettier.prettierPath": "./node_modules/prettier",
"typescript.enablePromptUseWorkspaceTsdk": true,
"eslint.codeActionsOnSave.rules": null
}
1 change: 0 additions & 1 deletion .yarnrc.yml

This file was deleted.

21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
FROM node:18-alpine

ENV NODE_ENV=development

WORKDIR /app

EXPOSE 3000

# debugging ports
EXPOSE 9229
EXPOSE 9230

COPY package.json ./
COPY pnpm-lock.yaml ./

RUN corepack enable
RUN pnpm install

COPY . .

CMD ["pnpm", "run", "dev:debug"]
16 changes: 16 additions & 0 deletions docker-compose.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
version: '3.1'

services:
app:
ports:
- '3000:3000'
- '9229:9229'
- '9230:9230'
build:
context: .
dockerfile: Dockerfile
env_file:
- .env.local
working_dir: /app
volumes:
- .:/app
5 changes: 3 additions & 2 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
{
"name": "zen-site-next",
"packageManager": "[email protected]",
"packageManager": "[email protected]+sha256.0624e30eff866cdeb363b15061bdb7fd9425b17bc1bb42c22f5f4efdea21f6b3",
"scripts": {
"dev": "next dev",
"dev:debug": "NODE_OPTIONS='--inspect' next dev",
"build": "next build",
"start": "next start",
"lint": "next lint",
Expand All @@ -20,7 +21,7 @@
"@sentry/nextjs": "^7.105.0",
"@vercel/analytics": "^1.2.2",
"@vercel/speed-insights": "^1.0.10",
"next": "^14.1.2",
"next": "^14.2.3",
"next-cloudinary": "^6.1.0",
"react": "^18.2.0",
"react-dom": "^18.2.0",
Expand Down
Loading

1 comment on commit c7d725a

@vercel
Copy link

@vercel vercel bot commented on c7d725a May 7, 2024

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please sign in to comment.