Compare commits

...

1 Commits

Author SHA1 Message Date
Tingluo Huang
d5a1710f1f Update docker-image.yml 2021-10-25 22:37:57 -04:00

View File

@@ -2,16 +2,12 @@ name: Build Alpine Node.js
permissions: permissions:
contents: write contents: write
on: on:
workflow_dispatch: workflow_dispatch:
inputs: inputs:
NodeVersion: NodeVersion:
required: true required: true
description: 'Node.js version to build (ex: v12.4.0)' description: 'Node.js version to build (ex: v12.22.7, v16.12.0)'
PythonVersion:
required: true
description: 'Node.js v12 needs python2 and Node.js v16 needs python3'
jobs: jobs:
build: build:
@@ -21,7 +17,15 @@ jobs:
- uses: actions/checkout@v2 - uses: actions/checkout@v2
- name: Build the Docker image - name: Build the Docker image
run: | run: |
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}} . NodeVersion="${{github.event.inputs.NodeVersion}}"
PythonVersion="python3"
if [[ $NodeVersion = v12* ]]
then
PythonVersion="python2"
fi
echo node.js version $NodeVersion
echo python version $PythonVersion
docker build --file Dockerfile --tag alpine_nodejs:${{github.event.inputs.NodeVersion}} --build-arg NodeVersion=${{github.event.inputs.NodeVersion}} --build-arg PythonVersion=$PythonVersion .
- name: Copy alpine node.js out - name: Copy alpine node.js out
run: | run: |
mkdir $RUNNER_TEMP/alpine_node mkdir $RUNNER_TEMP/alpine_node