Skip to content

update jdk 11 for node #8

update jdk 11 for node

update jdk 11 for node #8

name: Build Node 18 base on JDK 11
on:
push:
branches:
- master
paths:
# '*' matches any character except '/'
- '18-jdk11/*'
- '.github/workflows/build-node18-jdk11.yml'
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@master
- name: Docker login
env:
DOCKER_HUB_USERNAME: ${{ secrets. DOCKER_HUB_USERNAME }}
DOCKER_HUB_PASSWORD: ${{ secrets. DOCKER_HUB_PASSWORD }}
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
run: |
echo $DOCKER_HUB_PASSWORD | docker login --username $DOCKER_HUB_USERNAME --password-stdin
echo $GITHUB_TOKEN | docker login docker.pkg.github.com --username $GITHUB_ACTOR --password-stdin
- name: Build & Push Docker Image
run: |
cd 18-jdk11
IMAGE_NAME=ringcentral/node
GH_DOCKER_PKG_IMAGE_NAME=docker.pkg.github.com/ringcentral-docker/node/node
NODE_VERSION="$(awk '/ENV NODE_VERSION/ {print $3}' Dockerfile)"
NODE_MAJOR_VERSION="$(awk -F '[ .]' '/ENV NODE_VERSION/ {print $3}' Dockerfile)"
BASE_VERSION="$(awk -F '[:-]' '/FROM/ {print $3}' Dockerfile)"
docker build --tag ${IMAGE_NAME} --file Dockerfile .
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${NODE_VERSION}"
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${NODE_MAJOR_VERSION}"
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${NODE_VERSION}-${BASE_VERSION}"
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${NODE_MAJOR_VERSION}-${BASE_VERSION}"
docker push "${IMAGE_NAME}:${NODE_VERSION}"
docker push "${IMAGE_NAME}:${NODE_MAJOR_VERSION}"
docker push "${IMAGE_NAME}:${NODE_VERSION}-${BASE_VERSION}"
docker push "${IMAGE_NAME}:${NODE_MAJOR_VERSION}-${BASE_VERSION}"
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_VERSION}"
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_VERSION}-${BASE_VERSION}"
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_MAJOR_VERSION}"
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_MAJOR_VERSION}-${BASE_VERSION}"
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_VERSION}"
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_MAJOR_VERSION}"
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_VERSION}-${BASE_VERSION}"
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${NODE_MAJOR_VERSION}-${BASE_VERSION}"