-
Notifications
You must be signed in to change notification settings - Fork 0
110 lines (99 loc) · 3.79 KB
/
build_container.yml
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
107
108
109
110
name: Build and publish a 🛢️ container
on:
push:
branches:
- 'main'
tags:
- '*'
workflow_dispatch:
jobs:
setup-matrix:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
steps:
- name: Source checkout
uses: actions/checkout@v4
- name: 'Setup yq'
uses: dcarbone/[email protected]
- id: set-matrix
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT
build-X86-container:
runs-on: ubuntu-24.04
permissions:
contents: read
packages: write
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Build OpenVox Server ${{ matrix.release }} container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXAGENT_VERSION=${{ matrix.agent_version }}
build_arch: linux/amd64
build_context: .
buildfile: Containerfile
tags: |
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
build-ARM-container:
runs-on: ubuntu-24.04-arm
permissions:
contents: read
packages: write
needs: setup-matrix
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Build OpenVox Server ${{ matrix.release }} container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXAGENT_VERSION=${{ matrix.agent_version }}
build_arch: linux/arm64
build_context: .
buildfile: Containerfile
tags: |
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64
create-multi-arch-manifests:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
needs:
- setup-matrix
- build-X86-container
- build-ARM-container
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- name: Log in to the ghcr.io registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Extract version number
id: extract_version
uses: actions/github-script@v7
with:
script: |
const agentVersion = '${{ matrix.agent_version }}';
const version = agentVersion.split('-')[0];
core.setOutput('version', version);
- name: Create multi arch manifests
run: |
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:${{ steps.extract_version.outputs.version }}-${{ github.ref_name }} \
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:${{ steps.extract_version.outputs.version }}-latest \
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxagent:latest \
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxagent:${{ matrix.release }}-${{ github.sha }}-x86_64