Skip to content
This repository has been archived by the owner on Mar 15, 2021. It is now read-only.

New buildx + matrix build #23

Merged
merged 10 commits into from
May 21, 2020
10 changes: 7 additions & 3 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,27 @@ on:
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [linux/amd64, linux/s390x]
env:
IMAGE_FULL: quay.io/eclipse/che-workspace-loader:next
CACHE_IMAGE_FULL: docker.io/cheincubator/che-workspace-loader:cache
steps:
- uses: actions/checkout@v2
name: Checkout che-workspace-loader source code
- name: Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1.4.0
uses: crazy-max/ghaction-docker-buildx@v1.6.1
with:
version: v0.3.1
buildx-version: v0.4.1
- name: "Docker prepare"
run: docker image prune -a -f
- name: "Docker Quay.io Login"
run: docker login -u "${{ secrets.QUAY_USERNAME }}" -p "${{ secrets.QUAY_PASSWORD }}" quay.io
- name: "Docker docker.io Login"
run: docker login -u "${{ secrets.DOCKERHUB_USERNAME }}" -p "${{ secrets.DOCKERHUB_PASSWORD }}" docker.io
- name: "Docker build"
run: docker buildx build --platform linux/amd64,linux/s390x --cache-from="type=registry,ref=${CACHE_IMAGE_FULL}" --cache-to="type=registry,ref=${CACHE_IMAGE_FULL},mode=max" -t ${IMAGE_FULL} -f apache.Dockerfile --push .
run: docker buildx build --platform ${{ matrix.platform}} --cache-from="type=registry,ref=${CACHE_IMAGE_FULL}" --cache-to="type=registry,ref=${CACHE_IMAGE_FULL},mode=max" -t ${IMAGE_FULL} -f apache.Dockerfile --push .
- name: "Docker Logout"
run: docker logout
25 changes: 21 additions & 4 deletions .github/workflows/pr.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,34 @@ on:
jobs:
docker-build:
runs-on: ubuntu-latest
strategy:
fail-fast: false
matrix:
platform: [linux/amd64, linux/s390x]
layerscaching: [true, false]
env:
IMAGE_FULL: quay.io/eclipse/che-workspace-loader:next
CACHE_IMAGE_FULL: docker.io/cheincubator/che-workspace-loader:cache
steps:
- uses: actions/checkout@v2
name: Checkout che-workspace-loader source code
- name: Docker Buildx
uses: crazy-max/ghaction-docker-buildx@v1.4.0
uses: crazy-max/ghaction-docker-buildx@v1.6.1
with:
version: v0.3.1
buildx-version: v0.4.1
- name: "Docker prepare"
run: docker image prune -a -f
- name: "Docker build"
run: docker buildx build --platform linux/amd64,linux/s390x --cache-from="type=registry,ref=${CACHE_IMAGE_FULL}" -t ${IMAGE_FULL} -f apache.Dockerfile .
- name: "Docker build without cache"
if: ${{ matrix.layerscaching == false}}
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 5
command: docker buildx build --platform ${{ matrix.platform}} -t ${IMAGE_FULL} -f apache.Dockerfile .
- name: "Docker build with cache"
if: ${{ matrix.layerscaching == true}}
uses: nick-invision/retry@v1
with:
timeout_minutes: 10
max_attempts: 5
command: docker buildx build --platform ${{ matrix.platform}} --cache-from="type=registry,ref=${CACHE_IMAGE_FULL}" -t ${IMAGE_FULL} -f apache.Dockerfile .