-
Notifications
You must be signed in to change notification settings - Fork 0
107 lines (89 loc) · 2.78 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
96
97
98
99
100
101
102
103
104
105
106
name: Build Kassiopeia
on:
pull_request:
push:
branches: [main, develop]
tags: ['*']
workflow_dispatch:
env:
REGISTRY: ghcr.io
BASE_IMG_REPO: project8/luna_base
BASE_IMG_TAG: v1.3.4
KASS_REPO: project8/kassiopeia
KASS_TAG: v4.0.0
NARG: 2
jobs:
docker-build-and-publish:
name: Build and push the docker images
strategy:
matrix:
build: [Dev, Prod]
fail-fast: [false]
include:
- push: ${{ github.event_name == 'push' && contains(github.ref, 'refs/tags/') }}
- build: Dev
tag-suffix: '-dev'
build-type: Debug
build-tests: true
- build: Prod
tag-suffix: ''
build-type: Release
build-tests: false
runs-on: ubuntu-latest
steps:
- name: Checkout builder repo
uses: actions/checkout@v4
- name: Check out Kassiopeia
uses: actions/checkout@v4
with:
repository: ${{ env.KASS_REPO }}
ref: ${{ env.KASS_TAG }}
submodules: recursive
fetch-depth: 0
path: kassiopeia
- name: Docker meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: ${{ env.REGISTRY }}/${{ github.repository }}
flavor: |
latest=auto
suffix=${{ matrix.tag-suffix }},onlatest=true
tags: |
type=raw,value=${{ env.KASS_TAG }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
id: setup_buildx
uses: docker/setup-buildx-action@v3
with:
buildkitd-flags: --debug
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Build Kassiopeia
id: build-kass
uses: docker/build-push-action@v5
with:
context: .
file: Dockerfile
push: ${{ matrix.push }}
load: false
build-args: |
build_img_repo=${{ env.REGISTRY }}/${{ env.BASE_IMG_REPO }}
build_img_tag=${{ env.BASE_IMG_TAG }}-dev
final_img_repo=${{ env.REGISTRY }}/${{ env.BASE_IMG_REPO }}
final_img_tag=${{ env.BASE_IMG_TAG }}${{ matrix.tag-suffix }}
kass_tag=${{ env.KASS_TAG }}
build_type=${{ matrix.build-type }}
narg=${{ env.NARG }}
tags: ${{ steps.docker_meta.outputs.tags }}
platforms: linux/amd64
# platforms: ${{ matrix.push && 'linux/amd64,linux/arm64' || 'linux/amd64' }}
# For debugging
- name: Setup tmate session
if: ${{ ! success() }}
uses: mxschmitt/action-tmate@v3