Skip to content

Commit d5a1710

Browse files
authored
Update docker-image.yml
1 parent 03f937b commit d5a1710

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,13 @@
11
name: Build Alpine Node.js
22
permissions:
33
contents: write
4-
54

65
on:
76
workflow_dispatch:
87
inputs:
98
NodeVersion:
109
required: true
11-
description: 'Node.js version to build (ex: v12.4.0)'
12-
PythonVersion:
13-
required: true
14-
description: 'Node.js v12 needs python2 and Node.js v16 needs python3'
10+
description: 'Node.js version to build (ex: v12.22.7, v16.12.0)'
1511

1612
jobs:
1713
build:
@@ -21,7 +17,15 @@ jobs:
2117
- uses: actions/checkout@v2
2218
- name: Build the Docker image
2319
run: |
24-
docker build --file Dockerfile --tag alpine_nodejs:${{github.event.inputs.NodeVersion}} --build-arg NodeVersion=${{github.event.inputs.NodeVersion}} --build-arg PythonVersion=${{github.event.inputs.PythonVersion}} .
20+
NodeVersion="${{github.event.inputs.NodeVersion}}"
21+
PythonVersion="python3"
22+
if [[ $NodeVersion = v12* ]]
23+
then
24+
PythonVersion="python2"
25+
fi
26+
echo node.js version $NodeVersion
27+
echo python version $PythonVersion
28+
docker build --file Dockerfile --tag alpine_nodejs:${{github.event.inputs.NodeVersion}} --build-arg NodeVersion=${{github.event.inputs.NodeVersion}} --build-arg PythonVersion=$PythonVersion .
2529
- name: Copy alpine node.js out
2630
run: |
2731
mkdir $RUNNER_TEMP/alpine_node

0 commit comments

Comments
 (0)