2020-07-19 19:37:07 +02:00
|
|
|
name: Docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
env:
|
|
|
|
VERSION: latest
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
push:
|
|
|
|
name: Push
|
|
|
|
runs-on: ubuntu-latest
|
2020-12-04 03:05:20 +01:00
|
|
|
|
|
|
|
strategy:
|
2020-12-04 03:10:19 +01:00
|
|
|
fail-fast: false
|
|
|
|
|
2020-12-04 03:05:20 +01:00
|
|
|
matrix:
|
|
|
|
image:
|
|
|
|
- "alpine"
|
2020-12-06 05:04:21 +01:00
|
|
|
- "source"
|
2020-12-04 03:05:20 +01:00
|
|
|
- "java7"
|
|
|
|
- "java8"
|
|
|
|
- "java9"
|
|
|
|
- "java10"
|
|
|
|
- "java11"
|
|
|
|
- "java12"
|
|
|
|
- "java13"
|
|
|
|
- "java14"
|
2020-12-06 05:04:21 +01:00
|
|
|
- "java15"
|
2020-07-19 19:37:07 +02:00
|
|
|
|
|
|
|
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
|
|
|
|
|
2020-12-04 03:05:20 +01:00
|
|
|
- name: Build Image
|
2020-12-04 03:06:16 +01:00
|
|
|
run: docker build ./${{ matrix.image }} --tag ${{ matrix.image }}
|
2020-08-05 04:11:03 +02:00
|
|
|
|
2020-12-04 03:05:20 +01:00
|
|
|
- name: Push Image
|
2020-08-05 04:11:03 +02:00
|
|
|
run: |
|
2020-12-04 03:05:20 +01:00
|
|
|
IMAGE_NAME=${{ matrix.image }}
|
2020-08-05 04:11:03 +02:00
|
|
|
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
|