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

chore(website): set node version in dockerfile through arg, align with nvmrc, bump to 22 #1841

Merged
merged 8 commits into from
May 10, 2024
6 changes: 6 additions & 0 deletions .github/workflows/website.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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'
Expand Down
4 changes: 3 additions & 1 deletion website/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
Expand Down
Loading