forked from eclipse-che/che-workspace-loader
-
Notifications
You must be signed in to change notification settings - Fork 0
43 lines (43 loc) · 1.52 KB
/
ci.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
#
# 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: CI
# Trigger the workflow on push
on:
push:
branches:
- master
jobs:
docker-build:
runs-on: ubuntu-18.04
strategy:
fail-fast: 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 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 with cache"
uses: nick-invision/retry@v1
with:
timeout_minutes: 20
max_attempts: 5
command: 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 Logout"
run: docker logout