Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Monorepo investigation #141

Merged
merged 8 commits into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 6 additions & 2 deletions .github/workflows/chromatic.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16,11 +16,15 @@ jobs:
with:
fetch-depth: 0 # get full Git history

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Set up node
uses: actions/setup-node@v3
with:
node-version-file: '.nvmrc'
cache: 'npm'
cache: 'pnpm'

- name: Authenticate GitHub Packages
run: |
Expand All @@ -29,7 +33,7 @@ jobs:
NPM_PKG_TOKEN: ${{ secrets.GITHUB_TOKEN }}

- name: Install npm packages
run: npm ci
run: pnpm install

- name: Publish to Chromatic
if: github.ref != 'refs/heads/main'
Expand Down
15 changes: 9 additions & 6 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,10 @@ jobs:
id: node_version
run: echo ::set-output name=NODE_VERSION::$(cat .nvmrc)

- uses: pnpm/action-setup@v2
with:
version: 8

- name: Authenticate GitHub Packages
run: |
echo "//npm.pkg.github.com/:_authToken=${NPM_PKG_TOKEN}" > ~/.npmrc
Expand All @@ -51,18 +55,18 @@ jobs:
uses: actions/setup-node@v3
with:
node-version: ${{ steps.node_version.outputs.NODE_VERSION }}
cache: 'npm'
cache: 'pnpm'

- name: Install npm packages
run: npm ci
run: pnpm install

- name: Lint
run: |
npm run lint
npm run format:check
pnpm run lint
pnpm run format:check

- name: Build site
run: npm run build
run: pnpm run build

docker:
needs:
Expand Down Expand Up @@ -109,7 +113,6 @@ jobs:
# Only push tags or ticket branches
push: true
tags: |
lsstsqre/squareone:${{ steps.vars.outputs.tag }}
ghcr.io/lsst-sqre/squareone:${{ steps.vars.outputs.tag }}
target: production
cache-from: type=gha
Expand Down
17 changes: 8 additions & 9 deletions .storybook/main.js → .storybook/main.ts
Original file line number Diff line number Diff line change
@@ -1,22 +1,21 @@
const path = require('path');
import type { StorybookConfig } from '@storybook/nextjs';

module.exports = {
const config: StorybookConfig = {
stories: ['../src/**/*.stories.mdx', '../src/**/*.stories.@(js|jsx|ts|tsx)'],
addons: [
'@storybook/addon-links',
'@storybook/addon-essentials',
'@storybook/addon-interactions',
'@storybook/addon-a11y',
{
name: 'storybook-addon-next',
options: {
nextConfigPath: path.resolve(__dirname, '../next.config.js'),
},
},
],
framework: '@storybook/react',
framework: '@storybook/nextjs',
core: {
builder: '@storybook/builder-webpack5',
},
staticDirs: ['../public'],
docs: {
autodocs: true,
},
};

export default config;
10 changes: 6 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,16 +12,18 @@ WORKDIR /app

RUN echo "//npm.pkg.github.com/:_authToken=${GH_PKG_TOKEN}" > ~/.npmrc

COPY package.json package-lock.json .npmrc ./
RUN npm ci
COPY package.json pnpm-lock.yaml .npmrc ./
RUN npm install -g pnpm
RUN pnpm install

# Stage 2: Build application ==================================================
from node:16-alpine as builder
FROM node:16-alpine as builder

WORKDIR /app
COPY --from=deps /app/node_modules ./node_modules
COPY . .
RUN npm run build
RUN npm install -g pnpm
RUN pnpm run build

# Stage 3: Install pre-built app and deps for production ======================
FROM node:16-alpine as production
Expand Down
Loading
Loading