forked from eclipse-che/che-workspace-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
47 lines (47 loc) · 1.55 KB
/
pr.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
#
# Copyright (c) 2020 Red Hat, Inc.
# This program and the accompanying materials are made
# available under the terms of the Eclipse Public License 2.0
# which is available at https://www.eclipse.org/legal/epl-2.0/
#
# SPDX-License-Identifier: EPL-2.0
#
name: PR
# Trigger the workflow on push
on:
pull_request:
branches: [ master ]
jobs:
docker-build:
runs-on: ubuntu-18.04
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.6.2
with:
buildx-version: v0.4.1
- name: "Docker prepare"
run: docker image prune -a -f
- 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 .