-
Notifications
You must be signed in to change notification settings - Fork 23
52 lines (49 loc) · 1.33 KB
/
build-image.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
---
name: Build Image
on:
workflow_dispatch:
push:
branches: ['*']
tags: ['*']
env:
IMG_TAGS: ${{ github.sha }}
IMG_REGISTRY_HOST: quay.io
IMG_REGISTRY_ORG: kuadrant
MAIN_BRANCH_NAME: main
jobs:
build:
name: Build
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v2
- name: Add latest tag
if: ${{ github.ref_name == env.MAIN_BRANCH_NAME }}
run: |
echo "IMG_TAGS=${{ env.IMG_TAGS }} latest" >> $GITHUB_ENV
- name: Add branch name tag
if: ${{ github.ref_name != env.MAIN_BRANCH_NAME }}
run: |
echo "IMG_TAGS=${{ github.ref_name }}" >> $GITHUB_ENV
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build Docker image on amd64
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
build-args: |
GITHUB_SHA=${{ github.sha }}
tags: ${{ env.IMG_TAGS }}
file : ./Dockerfile
- name: Build Docker image on arm64
uses: docker/build-push-action@v5
with:
context: .
push: false
load: true
build-args: |
GITHUB_SHA=${{ github.sha }}
tags: ${{ env.IMG_TAGS }}
file : ./Dockerfile.aarch64