Skip to content

Commit 83f02b4

Browse files
committed
CI: simple test
1 parent a594ee7 commit 83f02b4

1 file changed

Lines changed: 40 additions & 15 deletions

File tree

.github/workflows/docker.yml

Lines changed: 40 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -10,19 +10,19 @@ jobs:
1010
strategy:
1111
matrix:
1212
include:
13-
- { image: v6, node: 6.10 }
14-
- { image: v7 }
15-
- { image: v8 }
16-
- { image: v9 }
17-
- { image: v10 }
18-
- { image: v11 }
19-
- { image: v12 }
20-
- { image: v13 }
21-
- { image: v14 }
22-
- { image: v15 }
23-
- { image: v16 }
24-
- { image: v17 }
25-
- { image: v18 }
13+
- image: v6
14+
- image: v7
15+
- image: v8
16+
- image: v9
17+
- image: v10
18+
- image: v11
19+
- image: v12
20+
- image: v13
21+
- image: v14
22+
- image: v15
23+
- image: v16
24+
- image: v17
25+
- image: v18
2626

2727
fail-fast: false
2828

@@ -44,10 +44,35 @@ jobs:
4444
- name: Set up Docker Buildx
4545
uses: docker/setup-buildx-action@v2
4646

47-
- name: Build and push
47+
- name: Build docker image
4848
uses: docker/build-push-action@v3
4949
with:
5050
context: ${{ matrix.image }}
5151
push: false
5252
tags: dockette/nodejs:${{ matrix.image }}
53-
platforms: ${{ matrix.platforms || 'linux/amd64,linux/arm64' }}
53+
platforms: linux/amd64,linux/arm64
54+
55+
- name: Load docker image
56+
uses: docker/build-push-action@v3
57+
with:
58+
context: ${{ matrix.image }}
59+
load: true
60+
tags: dockette/nodejs:${{ matrix.image }}
61+
62+
- name: Test node version
63+
run: |
64+
var="$(docker run --rm dockette/nodejs:${{ matrix.image }} node -v)"
65+
if [[ $var =~ "${{ matrix.image }}" ]]; then
66+
echo "Node version matched ${var} =~ ${{ matrix.image }}"
67+
else
68+
echo "Invalid node version ${var} != ${{ matrix.image }}"
69+
exit 255
70+
fi
71+
72+
- name: Push docker image
73+
uses: docker/build-push-action@v3
74+
with:
75+
context: ${{ matrix.image }}
76+
push: true
77+
tags: dockette/nodejs:${{ matrix.image }}
78+
platforms: linux/amd64,linux/arm64

0 commit comments

Comments
 (0)