Skip to content

Commit a26c82e

Browse files
authored
Merge pull request #3 from PostHog/feat/node-23-10
2 parents 411145c + b8af27c commit a26c82e

File tree

2 files changed

+19
-14
lines changed

2 files changed

+19
-14
lines changed

.github/workflows/docker-build-push.yml

Lines changed: 13 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -4,13 +4,16 @@ on:
44
push:
55
branches:
66
- main
7+
pull_request:
8+
branches:
9+
- main
710

811
jobs:
912
build:
1013
runs-on: ubuntu-latest
1114

1215
env:
13-
IMAGE_VERSION: bookworm_rust_1.82-node_18.19.1
16+
IMAGE_VERSION: bookworm_rust_1.82-node_23.10.0
1417

1518
steps:
1619
- name: Checkout code
@@ -20,15 +23,21 @@ jobs:
2023
uses: docker/setup-buildx-action@v1
2124

2225
- name: Login to GitHub Container Registry
26+
if: github.event_name == 'push'
2327
run: echo ${{ secrets.GITHUB_TOKEN }} | docker login ghcr.io -u ${{ github.repository_owner }} --password-stdin
2428

2529
- name: Build and push multi-platform Docker image
2630
run: |
2731
# Build and tag the Docker image with the version
2832
docker buildx create --use
29-
docker buildx build --push \
30-
--tag ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ env.IMAGE_VERSION }} \
31-
--platform linux/amd64,linux/arm64 .
33+
if [ "${{ github.event_name }}" = "push" ]; then
34+
docker buildx build --push \
35+
--tag ghcr.io/$(echo ${{ github.repository }} | tr '[:upper:]' '[:lower:]'):${{ env.IMAGE_VERSION }} \
36+
--platform linux/amd64,linux/arm64 .
37+
else
38+
docker buildx build \
39+
--platform linux/amd64,linux/arm64 .
40+
fi
3241
3342
env:
3443
DOCKER_CLI_ACI_AS_TEXT: "true"

Dockerfile

Lines changed: 6 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -45,12 +45,12 @@ RUN ((cat /etc/os-release | grep ID | grep alpine) && apk add --no-cache musl-de
4545
&& rm -rf $CARGO_HOME/registry/
4646

4747
# ----------------------
48-
# node 18.19.1 via https://github.com/nodejs/docker-node/blob/619b871fb3d89dc6d6333914b46bf526e781eec5/18/bookworm/Dockerfile
48+
# node 23.10.0 via https://github.com/nodejs/docker-node/blob/main/23/bookworm/Dockerfile
4949
# ----------------------
5050
RUN groupadd --gid 1000 node \
5151
&& useradd --uid 1000 --gid node --shell /bin/bash --create-home node
5252

53-
ENV NODE_VERSION 18.19.1
53+
ENV NODE_VERSION 23.10.0
5454

5555
RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
5656
&& case "${dpkgArch##*-}" in \
@@ -67,18 +67,14 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
6767
# gpg keys listed at https://github.com/nodejs/node#release-keys
6868
&& set -ex \
6969
&& for key in \
70-
4ED778F539E3634C779C87C6D7062848A1AB005C \
71-
141F07595B7B3FFE74309A937405533BE57C7D57 \
72-
74F12602B6F1C4E913FAA37AD3A89613643B6201 \
70+
C0D6248439F1D5604AAFFB4021D900FFDB233756 \
7371
DD792F5973C6DE52C432CBDAC77ABFA00DDBF2B7 \
74-
61FC681DFB92A079F1685E77973F295594EC4689 \
72+
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
7573
8FCCA13FEF1D0C2E91008E09770F7A9A5AE15600 \
76-
C4F0DFFF4E8C1A8236409D08E73BC641CC11F4C8 \
7774
890C08DB8579162FEE0DF9DB8BEAB4DFCF555EF4 \
7875
C82FA3AE1CBEDC6BE46B9360C43CEC45C17AB93C \
7976
108F52B48DB57BB0CC439B2997B01419BD92F80A \
8077
A363A499291CBBC940DD62E41F10027AF002F8B0 \
81-
CC68F5A3106FF448322E48ED27F5E38D5B0A215F \
8278
; do \
8379
gpg --batch --keyserver hkps://keys.openpgp.org --recv-keys "$key" || \
8480
gpg --batch --keyserver keyserver.ubuntu.com --recv-keys "$key" ; \
@@ -96,7 +92,7 @@ RUN ARCH= && dpkgArch="$(dpkg --print-architecture)" \
9692
&& node --version \
9793
&& npm --version
9894

99-
ENV YARN_VERSION 1.22.19
95+
ENV YARN_VERSION 1.22.22
10096

10197
RUN set -ex \
10298
# use pre-existing gpg directory, see https://github.com/nodejs/docker-node/pull/1895#issuecomment-1550389150
@@ -119,4 +115,4 @@ RUN set -ex \
119115
&& rm yarn-v$YARN_VERSION.tar.gz.asc yarn-v$YARN_VERSION.tar.gz \
120116
# smoke test
121117
&& yarn --version \
122-
&& rm -rf /tmp/*
118+
&& rm -rf /tmp/*

0 commit comments

Comments
 (0)