Skip to content

Commit 4f3cc0e

Browse files
authored
buid: simplify dockerimage jib
1 parent 8270bbd commit 4f3cc0e

File tree

1 file changed

+18
-5
lines changed

1 file changed

+18
-5
lines changed

.github/workflows/dockerimage.yml

+18-5
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,32 @@ on:
1010
jobs:
1111
build:
1212
runs-on: ubuntu-latest
13+
strategy:
14+
fail-fast: false
15+
matrix:
16+
node-version: [18, 20, 22]
17+
1318
steps:
1419
- uses: actions/[email protected]
1520

16-
- name: Build the Docker image
21+
- name: Build and test Docker image
1722
run: |
18-
docker run -i $(docker build -q 18) /bin/sh -c "node --version && npm --version && git --version"
19-
docker run -i $(docker build -q 20) /bin/sh -c "node --version && npm --version && git --version"
20-
docker run -i $(docker build -q 22) /bin/sh -c "node --version && npm --version && git --version"
23+
echo "Testing Node.js ${{ matrix.node-version }}"
24+
25+
# Build and test the Docker image
26+
IMAGE_PATH="${{ matrix.node-version }}"
27+
VERSIONS=$(docker run -i $(docker build -q ${IMAGE_PATH}) /bin/sh -c "node --version && npm --version && git --version")
28+
echo "$VERSIONS"
29+
30+
# Check Node.js version
31+
if ! echo "$VERSIONS" | grep -q "v${{ matrix.node-version }}"; then
32+
echo "::error::Expected Node.js v${{ matrix.node-version }} but got different version"
33+
exit 1
34+
fi
2135
2236
auto-merge:
2337
runs-on: ubuntu-latest
2438
needs: build
25-
2639
permissions:
2740
pull-requests: write
2841
contents: write

0 commit comments

Comments
 (0)