replace to public.ecr.aws/amazoncorretto #40
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Build OpenJDK 11 | |
on: | |
push: | |
branches: | |
- master | |
paths: | |
# '*' matches any character except '/' | |
- 'jdk11/*' | |
- '.github/workflows/build-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: | | |
IMAGE_NAME=ringcentral/jdk | |
GH_DOCKER_PKG_IMAGE_NAME=docker.pkg.github.com/ringcentral-docker/jdk/jdk | |
VERSION="$(awk -F= '/JAVA_VERSION=/ {print $2}' jdk11/Dockerfile | cut -d " " -f 1)" | |
DETAIL_VERSION="$(awk -F= '/JAVA_DETAIL_VERSION=/ {print $2}' jdk11/Dockerfile | cut -d " " -f 1)" | |
BASE_IMAGE="alpine" | |
docker build --tag ${IMAGE_NAME} --file jdk11/Dockerfile . | |
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${VERSION}" | |
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${VERSION}-${BASE_IMAGE}" | |
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${DETAIL_VERSION}" | |
docker tag "${IMAGE_NAME}" "${IMAGE_NAME}:${DETAIL_VERSION}-${BASE_IMAGE}" | |
docker push "${IMAGE_NAME}:${DETAIL_VERSION}-${BASE_IMAGE}" | |
docker push "${IMAGE_NAME}:${DETAIL_VERSION}" | |
docker push "${IMAGE_NAME}:${VERSION}-${BASE_IMAGE}" | |
docker push "${IMAGE_NAME}:${VERSION}" | |
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${VERSION}" | |
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${VERSION}-${BASE_IMAGE}" | |
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${DETAIL_VERSION}" | |
docker tag "${IMAGE_NAME}" "${GH_DOCKER_PKG_IMAGE_NAME}:${DETAIL_VERSION}-${BASE_IMAGE}" | |
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${DETAIL_VERSION}-${BASE_IMAGE}" | |
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${DETAIL_VERSION}" | |
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${VERSION}-${BASE_IMAGE}" | |
docker push "${GH_DOCKER_PKG_IMAGE_NAME}:${VERSION}" |