This repository was archived by the owner on Apr 17, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 5
73 lines (71 loc) · 2.68 KB
/
docker_release.yaml
File metadata and controls
73 lines (71 loc) · 2.68 KB
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
name: Maestro Knowledge Build and Upload Images
on:
push:
tags:
- "v*"
jobs:
build-upload:
strategy:
fail-fast: false
matrix:
include:
- arch: x86_64
runner: ubuntu-latest
- arch: arm64
runner: ubuntu-24.04-arm
runs-on: ${{ matrix.runner }}
permissions:
packages: write
outputs:
version: ${{ steps.version.outputs.version }}
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- uses: actions/checkout@v4
- name: get release version
id: version
run: |
VERSION=$(grep -E '^(version|tool\.poetry\.version) *= *"[^"]+"' "pyproject.toml" | \
head -n 1 | \
sed -E 's/.*"([^"]+)".*/\1/')
echo "version=$VERSION" >> $GITHUB_OUTPUT
- name: get docker-compatible GITHUB_ORG
id: org
run: |
echo "github_org=${OWNER,,}" >>${GITHUB_OUTPUT}
env:
OWNER: '${{ github.repository_owner }}'
- name: build and push docker image to ghcr.io
uses: docker/build-push-action@v6
with:
push: true
tags: ghcr.io/${{ steps.org.outputs.github_org }}/maestro-knowledge:${{ steps.version.outputs.version }}-${{ matrix.arch }}
upload-manifest:
needs: build-upload
runs-on: ubuntu-latest
permissions:
packages: write
steps:
- uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: get docker-compatible GITHUB_ORG
run: |
echo "GITHUB_ORG=${OWNER,,}" >>${GITHUB_ENV}
env:
OWNER: '${{ github.repository_owner }}'
- name: Push multi-arch image to ghcr.io
run: |
docker manifest create ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }} \
--amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-x86_64 \
--amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-arm64 &&
docker manifest create ghcr.io/$GITHUB_ORG/maestro-knowledge:latest \
--amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-x86_64 \
--amend ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}-arm64 &&
docker manifest push ghcr.io/$GITHUB_ORG/maestro-knowledge:${{ needs.build-upload.outputs.version }}
docker manifest push ghcr.io/$GITHUB_ORG/maestro-knowledge:latest