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

Commit

Permalink
New buildx + matrix build (#23)
Browse files Browse the repository at this point in the history
* New buildx + matrix build

 Upgrade of builds to v0.4.1
Upgrade of ghaction-docker-buildx to 1.6.1
matrix build for linux/amd64, linux/s390x platform in ci and pr checks
matrix build with cache for pr checks
5 retries for ci and pr check

Signed-off-by: Sergii Kabashniuk <[email protected]>
  • Loading branch information
skabashnyuk authored May 21, 2020
1 parent dd66987 commit c4e266e
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 8 deletions.
16 changes: 12 additions & 4 deletions .github/workflows/ci.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,23 +15,31 @@ 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 .
- name: "Docker build with cache"
uses: nick-invision/retry@v1
with:
timeout_minutes: 20
max_attempts: 5
command: 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 .

0 comments on commit c4e266e

Please sign in to comment.