Skip to content

Commit

Permalink
Bump node to 20.3 (#569)
Browse files Browse the repository at this point in the history
* refactor

* remove package manager

* use gh actions to install volta

* fix syntax error 🤡

* try removing sudo

* remove sudo from all...

* put packagemanager back in

* testing server

* update client deployments

* refactor docker file

* remove staging deployment from PR

* removed unused cds

* fix synta error

* make checkout step separate
  • Loading branch information
choden-dev authored Jul 2, 2024
1 parent 7668e7b commit 2949c5b
Show file tree
Hide file tree
Showing 11 changed files with 60 additions and 43 deletions.
16 changes: 8 additions & 8 deletions .github/workflows/check-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,20 +13,20 @@ 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

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
- run: yarn workspaces focus server
- run: yarn workspace server build
6 changes: 3 additions & 3 deletions .github/workflows/check-codegen.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/deploy-client-production.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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:
Expand Down
9 changes: 5 additions & 4 deletions .github/workflows/firebase-client-hosting-merge.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
10 changes: 6 additions & 4 deletions .github/workflows/firebase-client-hosting-pull-request.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}"
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/lint.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
6 changes: 3 additions & 3 deletions .github/workflows/prettier.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
8 changes: 4 additions & 4 deletions .github/workflows/test.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Binary file removed .nvmrc
Binary file not shown.
32 changes: 23 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,7 @@
]
},
"volta": {
"node": "20.0.0",
"node": "20.3.0",
"yarn": "4.1.1"
}
}

0 comments on commit 2949c5b

Please sign in to comment.