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

60 lines
1.4 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"
- "alpine-install"
- "java7"
- "java8"
- "java9"
- "java10"
- "java11"
- "java12"
- "java13"
- "java14"
2020-12-06 05:04:21 +01:00
- "java15"
- "source"
- "source-install"
steps:
- name: Code Checkout
uses: actions/checkout@v2
2020-12-15 17:01:10 +01:00
- name: Install buildx
uses: crazy-max/ghaction-docker-buildx@v1
with:
version: latest
- name: Registry Authentication
2020-12-15 17:04:56 +01:00
run: |
echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
- name: Build Image
2020-12-15 17:04:56 +01:00
env:
IMAGE_ID: docker.pkg.github.com/${{ github.repository }}/${{ matrix.image }}
run: |
2020-12-15 17:06:42 +01:00
docker buildx build ./${{ matrix.image }} --tag docker.pkg.github.com/${{ github.repository }}/${{ matrix.image }} --platform linux/amd64,linux/arm64
- name: Push Image
2020-12-15 17:04:56 +01:00
env:
IMAGE_ID: docker.pkg.github.com/${{ github.repository }}/${{ matrix.image }}
run: |
2020-12-15 17:04:56 +01:00
docker tag $IMAGE_ID $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION