Skip to content

fix: streamline server and db version handling in build workflow #55

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Jun 13, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 26 additions & 49 deletions .github/workflows/build_container.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,8 +13,6 @@ jobs:
runs-on: ubuntu-latest
outputs:
matrix: ${{ steps.set-matrix.outputs.matrix }}
server_version: ${{ steps.server_version.outputs.server_version }}
db_version: ${{ steps.db_version.outputs.db_version }}
steps:
- name: Source checkout
uses: actions/checkout@v4
Expand All @@ -25,12 +23,6 @@ jobs:
- id: set-matrix
run: echo "matrix=$(yq -o json build_versions.yaml | jq -c)" >> $GITHUB_OUTPUT

- id: server_version
run: echo "server_version=$(yq '.include[1].server_version' build_versions.yaml )" | cut -d- -f1 >> $GITHUB_OUTPUT

- id: db_version
run: echo "db_version=$(yq '.include[1].db_version' build_versions.yaml)" | cut -d- -f1 >> $GITHUB_OUTPUT

build-X86-container:
runs-on: ubuntu-24.04
permissions:
Expand All @@ -40,6 +32,12 @@ jobs:
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- id: server_version
run: echo "server_version=${{ matrix.server_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT

- id: db_version
run: echo "db_version=${{ matrix.db_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT

- name: Build OpenVox Server ${{ matrix.release }} container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
Expand All @@ -63,8 +61,8 @@ jobs:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXSERVER_VERSION=${{ needs.setup-matrix.outputs.server_version }}
OPENVOXDB_VERSION=${{ needs.setup-matrix.outputs.db_version }}
OPENVOXSERVER_VERSION=${{ steps.server_version.outputs.server_version }}
OPENVOXDB_VERSION=${{ steps.db_version.outputs.db_version }}
R10K_VERSION=${{ matrix.r10k_version }}
build_arch: linux/amd64
build_context: openvoxserver
Expand All @@ -81,6 +79,12 @@ jobs:
strategy:
matrix: ${{ fromJson(needs.setup-matrix.outputs.matrix) }}
steps:
- id: server_version
run: echo "server_version=${{ matrix.server_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT

- id: db_version
run: echo "db_version=${{ matrix.db_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT

- name: Build OpenVox Server ${{ matrix.release }} container
uses: voxpupuli/gha-build-and-publish-a-container@v2
with:
Expand All @@ -104,8 +108,8 @@ jobs:
registry_password: ${{ secrets.GITHUB_TOKEN }}
build_args: |
OPENVOX_RELEASE=${{ matrix.release }}
OPENVOXSERVER_VERSION=${{ needs.setup-matrix.outputs.server_version }}
OPENVOXDB_VERSION=${{ needs.setup-matrix.outputs.db_version }}
OPENVOXSERVER_VERSION=${{ steps.server_version.outputs.server_version }}
OPENVOXDB_VERSION=${{ steps.db_version.outputs.db_version }}
R10K_VERSION=${{ matrix.r10k_version }}
build_arch: linux/arm64
build_context: openvoxserver
Expand Down Expand Up @@ -139,17 +143,15 @@ jobs:
username: voxpupulibot
password: ${{ secrets.DOCKERHUB_BOT_ADMIN_TOKEN }}

- name: Create multi arch manifests
run: |
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-${{ github.ref_name }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64
- id: server_version
run: echo "server_version=${{ matrix.server_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT

docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-latest \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64
- id: db_version
run: echo "db_version=${{ matrix.db_version }}" | cut -d- -f1 >> $GITHUB_OUTPUT

docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-latest \
- name: Create multi arch manifests
run: |
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64

Expand All @@ -163,15 +165,7 @@ jobs:

# on docker.io we use the voxpupuli namespace because new organizations are not free anymore
#
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-${{ github.ref_name }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64

docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-latest \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64

docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ matrix.release }}-latest \
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }} \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64 \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64

Expand All @@ -186,15 +180,7 @@ jobs:
- name: Create Alpine multi arch manifests
if: ${{ matrix.release == '8' }}
run: |
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-${{ github.ref_name }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64-alpine

docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-latest-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64-alpine

docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-latest-alpine-beta \
docker buildx imagetools create -t ghcr.io/openvoxproject/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64-alpine

Expand All @@ -207,16 +193,7 @@ jobs:
ghcr.io/openvoxproject/openvoxserver:8-${{ github.sha }}-x86_64-alpine

# on docker.io we use the voxpupuli namespace because new organizations are not free anymore
#
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-${{ github.ref_name }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64-alpine

docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ needs.setup-matrix.outputs.server_version }}-latest-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64-alpine

docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ matrix.release }}-latest-alpine-beta \
docker buildx imagetools create -t docker.io/voxpupuli/openvoxserver:${{ steps.server_version.outputs.server_version }}-${{ github.ref_name }}-alpine-beta \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-arm64-alpine \
ghcr.io/openvoxproject/openvoxserver:${{ matrix.release }}-${{ github.sha }}-x86_64-alpine

Expand Down
Loading