-
Notifications
You must be signed in to change notification settings - Fork 0
95 lines (83 loc) · 2.64 KB
/
build.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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
---
name: "build images"
on:
push:
branches:
- dev
- master
tags:
- autoheal-*
- cypress-*
- minio-*
- runner-*
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 60
steps:
- name: Set environment
run: |
BRANCH=${GITHUB_REF#refs/heads/}
TAG=${GITHUB_REF#refs/tags/}
echo "NAME=" >> $GITHUB_ENV
echo "VERSION=${BRANCH//master/latest}" >> $GITHUB_ENV
# Support for git tags e.g. 'cypress-8.3.0'
if [ ${GITHUB_REF} != ${TAG} ]; then
echo "NAME=${TAG%-*}" >> $GITHUB_ENV
echo "VERSION=${TAG#*-}" >> $GITHUB_ENV
fi
- name: Checkout
uses: actions/checkout@v2
- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all
- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master
- name: Login to GitHub Container Registry
uses: docker/login-action@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build autoheal
uses: docker/build-push-action@v2
if: ${{ env.NAME == 'autoheal' || env.NAME == '' }}
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./autoheal/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/taitounited/autoheal:${{ env.VERSION }}
- name: Build minio
uses: docker/build-push-action@v2
if: ${{ env.NAME == 'minio' || env.NAME == '' }}
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./minio/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/taitounited/minio:${{ env.VERSION }}
- name: Build runner
uses: docker/build-push-action@v2
if: ${{ env.NAME == 'runner' || env.NAME == '' }}
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./runner/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/taitounited/runner:${{ env.VERSION }}
- name: Build cypress
uses: docker/build-push-action@v2
if: ${{ env.NAME == 'cypress' || env.NAME == '' }}
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./cypress/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ghcr.io/taitounited/cypress:${{ env.VERSION }}