Skip to content

Commit

Permalink
chore(website): set node version in dockerfile through arg, align wit…
Browse files Browse the repository at this point in the history
…h nvmrc, bump to 22 (#1841)
  • Loading branch information
corneliusroemer authored May 10, 2024
1 parent ac470d4 commit 10fd46a
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
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

0 comments on commit 10fd46a

Please sign in to comment.