diff --git a/.github/workflows/check-builds.yml b/.github/workflows/check-builds.yml index 24a87c2bb..3643ea5d0 100644 --- a/.github/workflows/check-builds.yml +++ b/.github/workflows/check-builds.yml @@ -13,11 +13,11 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Enable corepack - run: corepack enable + - name: Install volta + uses: volta-cli/action@v4 - - run: sudo yarn workspaces focus client - - run: sudo yarn workspace client build + - run: yarn workspaces focus client + - run: yarn workspace client build check_server_build: runs-on: ubuntu-latest @@ -25,8 +25,8 @@ jobs: steps: - uses: actions/checkout@v3 - - name: Enable corepack - run: corepack enable + - name: Install volta + uses: volta-cli/action@v4 - - run: sudo yarn workspaces focus server - - run: sudo yarn workspace server build \ No newline at end of file + - run: yarn workspaces focus server + - run: yarn workspace server build \ No newline at end of file diff --git a/.github/workflows/check-codegen.yml b/.github/workflows/check-codegen.yml index 833245f78..64c38f035 100644 --- a/.github/workflows/check-codegen.yml +++ b/.github/workflows/check-codegen.yml @@ -14,11 +14,11 @@ jobs: - name: Checkout code uses: actions/checkout@v2 - - name: Enable corepack - run: corepack enable + - name: Install volta + uses: volta-cli/action@v4 - name: Install dependencies - run: sudo yarn + run: yarn - name: Generate server code run: yarn workspace server tsoa spec-and-routes diff --git a/.github/workflows/deploy-client-production.yml b/.github/workflows/deploy-client-production.yml index 3e620f879..1b673549f 100644 --- a/.github/workflows/deploy-client-production.yml +++ b/.github/workflows/deploy-client-production.yml @@ -20,12 +20,12 @@ jobs: environment: Client Production steps: - - name: Enable corepack - run: corepack enable - - uses: actions/checkout@v3 - - run: cd client && yarn workspaces focus client && yarn run build + - name: Install volta + uses: volta-cli/action@v4 + + - run: yarn workspaces focus client && yarn workspace client build - uses: FirebaseExtended/action-hosting-deploy@v0 with: diff --git a/.github/workflows/firebase-client-hosting-merge.yml b/.github/workflows/firebase-client-hosting-merge.yml index 8f4f841b3..183eaaf28 100644 --- a/.github/workflows/firebase-client-hosting-merge.yml +++ b/.github/workflows/firebase-client-hosting-merge.yml @@ -21,12 +21,13 @@ jobs: build_and_deploy: runs-on: ubuntu-latest steps: + - uses: actions/checkout@v3 - - name: Enable corepack - run: corepack enable + - name: Install volta + uses: volta-cli/action@v4 + + - run: yarn workspaces focus client && yarn workspace client build - - uses: actions/checkout@v3 - - run: cd client && yarn workspaces focus client && yarn run build - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/firebase-client-hosting-pull-request.yml b/.github/workflows/firebase-client-hosting-pull-request.yml index d2b9b94ff..9fcbc94d2 100644 --- a/.github/workflows/firebase-client-hosting-pull-request.yml +++ b/.github/workflows/firebase-client-hosting-pull-request.yml @@ -19,12 +19,14 @@ jobs: Build-And-Preview: if: "${{ github.event.pull_request.head.repo.full_name == github.repository }}" runs-on: ubuntu-latest - steps: - - name: Enable corepack - run: corepack enable + steps: - uses: actions/checkout@v3 - - run: cd client && yarn workspaces focus client && yarn run build + + - name: Install volta + uses: volta-cli/action@v4 + + - run: yarn workspaces focus client && yarn workspace client build - uses: FirebaseExtended/action-hosting-deploy@v0 with: repoToken: "${{ secrets.GITHUB_TOKEN }}" diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml index 042c433c4..60a58677d 100644 --- a/.github/workflows/lint.yml +++ b/.github/workflows/lint.yml @@ -10,14 +10,14 @@ jobs: name: Lint runs-on: ubuntu-latest steps: - - name: Enable corepack - run: corepack enable + - name: Install volta + uses: volta-cli/action@v4 - name: Checkout repository uses: actions/checkout@3df4ab11eba7bda6032a0b82a6bb43b11571feac - name: Install NPM dependencies - run: sudo yarn + run: yarn - name: Run ESLint on ALL files run: yarn lint-all diff --git a/.github/workflows/prettier.yml b/.github/workflows/prettier.yml index 7726b2b36..f402157a6 100644 --- a/.github/workflows/prettier.yml +++ b/.github/workflows/prettier.yml @@ -10,8 +10,8 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Enable corepack - run: corepack enable + - name: Install volta + uses: volta-cli/action@v4 - - run: sudo yarn + - run: yarn - run: yarn prettier:ci diff --git a/.github/workflows/test.yml b/.github/workflows/test.yml index 0ddd9937b..0165dce6e 100644 --- a/.github/workflows/test.yml +++ b/.github/workflows/test.yml @@ -14,9 +14,9 @@ jobs: steps: - uses: actions/checkout@v2 - - name: Enable corepack - run: corepack enable + - name: Install volta + uses: volta-cli/action@v4 - - run: sudo npm install -g firebase-tools - - run: sudo yarn + - run: npm install -g firebase-tools + - run: yarn - run: yarn test diff --git a/.nvmrc b/.nvmrc deleted file mode 100644 index 889c7aabc..000000000 Binary files a/.nvmrc and /dev/null differ diff --git a/Dockerfile b/Dockerfile index 049c2d6ae..217cad276 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,23 +1,37 @@ # syntax = docker/dockerfile:1 -# Adjust NODE_VERSION as desired -ARG NODE_VERSION=20 -FROM node:${NODE_VERSION}-slim as base +FROM debian:stable-slim as base LABEL fly_launch_runtime="Node.js" # Node.js app lives here WORKDIR /app -# Set production environment -RUN corepack enable +# curl and ca-certificates are needed for volta installation +RUN apt-get update \ + && apt-get install -y \ + curl \ + ca-certificates \ + --no-install-recommends + +# bash will load volta() function via .bashrc +# using $VOLTA_HOME/load.sh +SHELL ["/bin/bash", "-c"] + +# since we're starting non-interactive shell, +# we wil need to tell bash to load .bashrc manually +ENV BASH_ENV ~/.bashrc +# needed by volta() function +ENV VOLTA_HOME /root/.volta +# make sure packages managed by volta will be in PATH +ENV PATH $VOLTA_HOME/bin:$PATH + +# install volta +RUN curl https://get.volta.sh | bash +RUN volta install node # Throw-away build stage to reduce size of final image FROM base as install -# Install packages needed to build node modules -RUN apt-get update -qq && \ - apt-get install --no-install-recommends -y build-essential node-gyp pkg-config python-is-python3 - # Install node modules COPY --link package.json yarn.lock .yarnrc.yml tsconfig.json ./ COPY --link ./server ./server diff --git a/package.json b/package.json index a4316463a..8205d45f7 100644 --- a/package.json +++ b/package.json @@ -70,7 +70,7 @@ ] }, "volta": { - "node": "20.0.0", + "node": "20.3.0", "yarn": "4.1.1" } }