yolks/.github/workflows/docker-publish.yml
2020-08-04 20:11:03 -06:00

130 lines
3.8 KiB
YAML

name: Docker
on:
push:
branches:
- master
env:
VERSION: latest
jobs:
push:
name: Push
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- name: Code Checkout
uses: actions/checkout@v2
- name: Registry Authentication
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Build alpine Image
run: docker build ./alpine --tag alpine
- name: Build java7 Image
run: docker build ./java7 --tag java7
- name: Build java8 Image
run: docker build ./java8 --tag java8
- name: Build java9 Image
run: docker build ./java9 --tag java9
- name: Build java10 Image
run: docker build ./java10 --tag java10
- name: Build java11 Image
run: docker build ./java11 --tag java11
- name: Build java12 Image
run: docker build ./java12 --tag java12
- name: Build java13 Image
run: docker build ./java13 --tag java13
- name: Build java14 Image
run: docker build ./java14 --tag java14
- name: Push alpine Image
run: |
IMAGE_NAME=alpine
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java7 Image
run: |
IMAGE_NAME=java7
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java8 Image
run: |
IMAGE_NAME=java8
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java9 Image
run: |
IMAGE_NAME=java9
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java10 Image
run: |
IMAGE_NAME=java10
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java11 Image
run: |
IMAGE_NAME=java11
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java12 Image
run: |
IMAGE_NAME=java12
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java13 Image
run: |
IMAGE_NAME=java13
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION
- name: Push java14 Image
run: |
IMAGE_NAME=java14
IMAGE_ID=docker.pkg.github.com/${{ github.repository }}/$IMAGE_NAME
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION