yolks/.github/workflows/docker-publish.yml

50 lines
1 KiB
YAML
Raw Normal View History

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