Skip to content
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
4 changes: 0 additions & 4 deletions .eslintignore

This file was deleted.

69 changes: 0 additions & 69 deletions .eslintrc

This file was deleted.

26 changes: 15 additions & 11 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ name: CI
on:
pull_request:
paths:
- "src/**"
- "packages/**"
- ".eslint*"
- ".github/workflows/ci.yml"

Expand All @@ -12,41 +12,45 @@ jobs:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Enable corepack
run: corepack enable

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: "20"
cache: "yarn"
node-version: "22"
cache: "pnpm"

- name: Cache eslint
uses: actions/cache@v2
uses: actions/cache@v4
with:
path: ${{ github.workspace }}/.eslintcache
key: ${{ runner.os }}-eslint-${{ hashFiles('**/yarn.lock') }}-${{ hashFiles('**/*.ts') }}
key: ${{ runner.os }}-eslint-${{ hashFiles('**/pnpm-lock.yaml') }}-${{ hashFiles('**/*.ts') }}
restore-keys: |
${{ runner.os }}-eslint-

- name: Install dependencies
run: |
# Main app
yarn install
pnpm install

- name: Build app
run: |
# Main app
yarn build
pnpm build
env:
CI: true

- name: Lint and Type-check
run: |
# Linting
yarn lint
# Temporarily disabled due to code drift while this script wasn't running
Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

This workflow has been broken for ages so it hasn't been linting the files. I'm fixing lint issues in a separate branch and then we can re-enable this.

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

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

# pnpm lint

# Typescript type checks
yarn type-check
pnpm type-check

# TODO: tests
env:
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/deploy-eval-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "22"

- name: Enable corepack
run: corepack enable

- name: Build & Publish
run: |
if [ ! -v NPM_TOKEN ]; then echo "NPM_TOKEN not set"; exit 1; fi;
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
yarn install
yarn build:deps:proxy
pnpm install
pnpm build:deps:proxy
cd packages/lib/eval
npm publish
4 changes: 2 additions & 2 deletions .github/workflows/deploy-proxy-custom-tag.yml
Original file line number Diff line number Diff line change
Expand Up @@ -19,12 +19,12 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.ref }}

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
Expand Down
13 changes: 8 additions & 5 deletions .github/workflows/deploy-proxy-npm.yml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,21 @@ jobs:

steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Setup Node
uses: actions/setup-node@v3
uses: actions/setup-node@v4
with:
node-version: '20'
node-version: "22"

- name: Enable corepack
run: corepack enable

- name: Build & Publish
run: |
if [ ! -v NPM_TOKEN ]; then echo "NPM_TOKEN not set"; exit 1; fi;
npm set //registry.npmjs.org/:_authToken $NPM_TOKEN
yarn install
yarn build:proxy
pnpm install
pnpm build:proxy
cd packages/apps/proxy
npm publish
4 changes: 2 additions & 2 deletions .github/workflows/deploy-proxy.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,10 +16,10 @@ jobs:
id-token: write
steps:
- name: Checkout code
uses: actions/checkout@v2
uses: actions/checkout@v4

- name: Login to Docker Hub
uses: docker/login-action@v1
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
Expand Down
1 change: 1 addition & 0 deletions .npmrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
inject-workspace-packages=true
33 changes: 21 additions & 12 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -8,28 +8,37 @@ RUN apt-get install -y ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

RUN corepack enable && corepack prepare pnpm@10.30.1 --activate

# Copy over minimum files to install dependencies
COPY package.json ./package.json
COPY yarn.lock ./yarn.lock
COPY pnpm-lock.yaml ./pnpm-lock.yaml
COPY pnpm-workspace.yaml ./pnpm-workspace.yaml
COPY .npmrc ./.npmrc
COPY packages/apps/proxy/package.json ./packages/apps/proxy/package.json
COPY packages/lib/eval/package.json ./packages/lib/eval/package.json
# Yarn install with dev dependencies
RUN yarn install --frozen-lockfile --ignore-optional
RUN yarn cache clean
# Pnpm install with dev dependencies
RUN pnpm install --frozen-lockfile --no-optional

# Build the proxy app and do a clean install with only production dependencies
COPY packages ./packages
RUN \
yarn build:proxy \
&& rm -rf node_modules \
&& rm -rf packages/apps/proxy/node_modules \
&& rm -rf packages/lib/eval/node_modules \
&& yarn install --frozen-lockfile --production=true --ignore-optional \
&& yarn cache clean
RUN npm uninstall -g npm
pnpm build:proxy \
&& pnpm deploy --filter=@growthbook/proxy --prod /app/pruned


FROM node:22-slim
WORKDIR /app
RUN apt-get update && apt-get -y upgrade && \
apt-get install -y ca-certificates && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*

COPY --from=0 /app/pruned/node_modules ./node_modules
COPY --from=0 /app/pruned/package.json ./package.json
COPY --from=0 /usr/local/src/app/packages/apps/proxy/dist ./dist
# Directory with build info (git commit sha, build date)
COPY buildinfo* ./buildinfo

EXPOSE 3300
CMD ["yarn","start"]
CMD ["node_modules/.bin/pm2-runtime", "start", "dist/index.js"]
Loading