11# SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
22
3- name : Publish Beman devcontainers
3+ name : Publish Beman Containers
44
55on :
66 push :
77 paths :
88 - " .github/workflows/build_devcontainer.yml"
9- - " devcontainer /**"
9+ - " containers /**"
1010 workflow_dispatch :
1111
1212env :
1313 REGISTRY : ghcr.io
14- DEBUG_IMAGE_NAME : ${{ github.repository }}
15- DEPLOY_IMAGE_NAME : bemanproject/devcontainers
14+ DEBUG_NAME : ${{ github.repository }}
15+ DEPLOY_DEV_NAME_PREFIX : bemanproject/devcontainers
16+ DEPLOY_TESTING_NAME_PREFIX : bemanproject/testingcontainers
17+ BASE_IMAGE_DEV : mcr.microsoft.com/devcontainers/cpp:1-ubuntu-24.04
18+ BASE_IMAGE_TEST : ubuntu:24.04
1619
1720permissions :
1821 packages : write
1922
2023jobs :
21- build-and-push-devcontainer-image :
24+ containers :
2225 runs-on : ubuntu-latest
2326 strategy :
2427 fail-fast : false
2528 matrix :
26- include :
27- - kind : gnu
29+ compilers :
30+ - kind : gcc
2831 version : 14
29- - kind : llvm
32+ - kind : gcc
33+ version : 13
34+ - kind : gcc
35+ version : 12
36+ - kind : gcc
37+ version : 11
38+ - kind : clang
39+ version : 21
40+ - kind : clang
41+ version : 20
42+ - kind : clang
3043 version : 19
31- name : " devcontainer: ${{ matrix.kind }}-${{ matrix.version }}"
44+ - kind : clang
45+ version : 18
46+ - kind : clang
47+ version : 17
48+ usage : [dev, test]
49+ name : " ${{ matrix.usage }}: ${{ matrix.compilers.kind }}-${{ matrix.compilers.version }}"
3250 steps :
3351 - name : Compute Image Name
3452 id : image_name
3553 run : |
36- image_name=${{ env.DEPLOY_IMAGE_NAME }}
3754 if [ "${{ github.repository }}/${{ github.ref }}" != "bemanproject/infra/refs/heads/main" ]; then
38- image_name=${{ env.DEBUG_IMAGE_NAME }}
55+ image_name="${{ env.DEBUG_NAME }}"
56+ tag="${{ matrix.usage }}-${{ matrix.compilers.kind }}-${{ matrix.compilers.version }}"
57+ else
58+ if [ "${{ matrix.usage }}" = "dev" ]; then
59+ image_name="${{ env.DEPLOY_DEV_NAME_PREFIX }}-${{ matrix.compilers.kind }}"
60+ else
61+ image_name="${{ env.DEPLOY_TESTING_NAME_PREFIX }}-${{ matrix.compilers.kind }}"
62+ fi
63+ tag="${{ matrix.compilers.version }}"
3964 fi
40- echo "computed image name: $image_name"
65+
66+ echo "Image Name: $image_name, Tag: $tag"
67+
4168 echo "image_name=$image_name" >> "$GITHUB_OUTPUT"
69+ echo "tag=$tag" >> "$GITHUB_OUTPUT"
70+ - name : Compute Image base
71+ id : image_base
72+ run : |
73+ if [ "${{ matrix.usage }}" == "dev" ]; then
74+ echo "image=${{ env.BASE_IMAGE_DEV }}" >> "$GITHUB_OUTPUT"
75+ else
76+ echo "image=${{ env.BASE_IMAGE_TEST }}" >> "$GITHUB_OUTPUT"
77+ fi
4278 - name : Checkout repository
4379 uses : actions/checkout@v4
4480 - name : Log in to the Container registry
@@ -50,11 +86,12 @@ jobs:
5086 - name : Build and push Docker image
5187 uses : docker/build-push-action@v6
5288 with :
53- context : devcontainer
89+ context : containers
5490 build-args : |
55- compiler_kind=${{ matrix.kind }}
56- compiler_version=${{ matrix.version }}
91+ base_image=${{ steps.image_base.outputs.image }}
92+ compiler_kind=${{ matrix.compilers.kind }}
93+ compiler_version=${{ matrix.compilers.version }}
5794 push : true
58- tags : ${{ env.REGISTRY }}/${{ steps.image_name.outputs.image_name }}:${{ matrix.kind }}-${{ matrix.version }}
95+ tags : ${{ env.REGISTRY }}/${{ steps.image_name.outputs.image_name }}:${{ steps.image_name.outputs.tag }}
5996 # https://github.com/docker/build-push-action/issues/894
6097 provenance : false
0 commit comments