2020-07-19 19:37:07 +02:00
|
|
|
name: Docker
|
|
|
|
|
|
|
|
on:
|
|
|
|
push:
|
|
|
|
branches:
|
|
|
|
- master
|
|
|
|
|
|
|
|
jobs:
|
|
|
|
push:
|
|
|
|
name: Push
|
2020-12-15 17:43:25 +01:00
|
|
|
runs-on: ubuntu-20.04
|
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-15 17:48:07 +01:00
|
|
|
#- "alpine-install"
|
|
|
|
#- "java7"
|
|
|
|
#- "java8"
|
|
|
|
#- "java9"
|
|
|
|
#- "java10"
|
|
|
|
#- "java11"
|
|
|
|
#- "java12"
|
|
|
|
#- "java13"
|
|
|
|
#- "java14"
|
|
|
|
#- "java15"
|
2020-12-15 17:19:26 +01:00
|
|
|
#- "source"
|
|
|
|
#- "source-install"
|
2020-07-19 19:37:07 +02:00
|
|
|
|
|
|
|
steps:
|
|
|
|
- name: Code Checkout
|
|
|
|
uses: actions/checkout@v2
|
|
|
|
|
2020-12-15 17:01:10 +01:00
|
|
|
- name: Install buildx
|
2020-12-15 17:19:26 +01:00
|
|
|
uses: docker/setup-buildx-action@v1
|
2020-12-15 17:25:15 +01:00
|
|
|
with:
|
2020-12-15 17:26:47 +01:00
|
|
|
version: v0.5.1
|
2020-12-15 17:50:38 +01:00
|
|
|
buildkitd-flags: --debug
|
2020-12-15 17:01:10 +01:00
|
|
|
|
2020-12-15 17:54:04 +01:00
|
|
|
# - name: Registry Authentication
|
|
|
|
# run: |
|
|
|
|
# echo "${{ secrets.GITHUB_TOKEN }}" | docker login docker.pkg.github.com -u ${{ github.actor }} --password-stdin
|
|
|
|
|
|
|
|
# - name: Build Image
|
|
|
|
# env:
|
|
|
|
# IMAGE_ID: docker.pkg.github.com/${{ github.repository }}/${{ matrix.image }}:latest
|
|
|
|
# run: |
|
|
|
|
# docker buildx build --push --platform=linux/amd64 --tag=$IMAGE_ID ./${{ matrix.image }}
|
|
|
|
|
|
|
|
- name: Set up containerd
|
|
|
|
uses: crazy-max/ghaction-setup-containerd@v1
|
2020-07-19 19:37:07 +02:00
|
|
|
|
2020-12-15 17:54:04 +01:00
|
|
|
- name: Build Docker image
|
|
|
|
uses: docker/build-push-action@v2
|
|
|
|
with:
|
|
|
|
context: ./alpine
|
|
|
|
file: ./Dockerfile
|
|
|
|
platforms: linux/amd64
|
|
|
|
tags: docker.pkg.github.com/${{ github.repository }}/${{ matrix.image }}:latest
|
|
|
|
outputs: type=oci,dest=/tmp/image.tar
|
|
|
|
|
|
|
|
- name: Import image in containerd
|
|
|
|
run: |
|
|
|
|
sudo ctr i import --base-name docker.io/user/app --digests --all-platforms /tmp/image.tar
|
|
|
|
- name: Push image with containerd
|
2020-12-15 17:04:56 +01:00
|
|
|
run: |
|
2020-12-15 17:54:04 +01:00
|
|
|
sudo ctr --debug i push --user "${{ github.actor }}:${{ secrets.GITHUB_TOKEN }}" docker.pkg.github.com/${{ github.repository }}/${{ matrix.image }}:latest
|