From 10fd46adcb18bb9e64dbc1ab07972e8adf3c3453 Mon Sep 17 00:00:00 2001 From: Cornelius Roemer Date: Fri, 10 May 2024 10:22:17 +0200 Subject: [PATCH] chore(website): set node version in dockerfile through arg, align with nvmrc, bump to 22 (#1841) --- .github/workflows/website.yml | 6 ++++++ website/Dockerfile | 4 +++- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/.github/workflows/website.yml b/.github/workflows/website.yml index d4ff85b3c..a961df002 100644 --- a/.github/workflows/website.yml +++ b/.github/workflows/website.yml @@ -63,6 +63,11 @@ jobs: - name: Set up Docker Buildx uses: docker/setup-buildx-action@v3 + - name: Get node version build arg + run: | + NODE_VERSION=$(cat website/.nvmrc | tr -cd [:digit:].) + echo "NODE_VERSION=$NODE_VERSION" >> $GITHUB_ENV + - name: Build and push image if: env.CACHE_HIT == 'false' uses: docker/build-push-action@v5 @@ -73,6 +78,7 @@ jobs: cache-from: type=gha,scope=website-${{ github.ref }} cache-to: type=gha,mode=max,scope=website-${{ github.ref }} platforms: ${{ env.BUILD_ARM && 'linux/amd64,linux/arm64' || 'linux/amd64' }} + build-args: NODE_VERSION=${{ env.NODE_VERSION }} - name: Retag and push existing image if cache hit if: env.CACHE_HIT == 'true' diff --git a/website/Dockerfile b/website/Dockerfile index 972b3892c..d42da7f46 100644 --- a/website/Dockerfile +++ b/website/Dockerfile @@ -1,4 +1,6 @@ -FROM node:lts-alpine as base +ARG NODE_VERSION=22 +FROM node:${NODE_VERSION}-alpine as base + WORKDIR /app COPY .env.docker .env