|
4 | 4 | push: |
5 | 5 | paths: |
6 | 6 | - .github/workflows/debian.yml |
7 | | - - docker/debian/Dockerfile |
| 7 | + - docker/debian/Dockerfile* |
8 | 8 | - test |
9 | 9 | workflow_dispatch: |
10 | 10 |
|
|
96 | 96 | echo "CONTAINER_REPOSITORY_GCC=${CONTAINER_REPO}/debian-gcc" >> $GITHUB_ENV |
97 | 97 | echo "CONTAINER_IMAGE_GCC=${CONTAINER_REGISTRY}/${CONTAINER_REPO}/debian-gcc" >> $GITHUB_ENV |
98 | 98 | fi |
| 99 | + - name: Prepare gcc image metadata |
| 100 | + if: ${{ env.CONTAINER_IMAGE_GCC }} |
| 101 | + id: meta-gcc |
| 102 | + uses: docker/metadata-action@v5 |
| 103 | + env: |
| 104 | + DOCKER_METADATA_ANNOTATIONS_LEVELS: manifest,manifest-descriptor |
| 105 | + with: |
| 106 | + images: ${{ env.CONTAINER_IMAGE_GCC }} |
| 107 | + labels: | |
| 108 | + org.opencontainers.image.authors=For inquiries, please use https://${{ github.repository }}/issues |
| 109 | + org.opencontainers.image.documentation=https://${{ github.repository }} |
| 110 | + org.opencontainers.image.vendor=XRPLF |
| 111 | + org.opencontainers.image.title=${{ env.CONTAINER_REPOSITORY_GCC }} |
| 112 | + - name: Build gcc image |
| 113 | + # Note, we always push this image, otherwise steps.build will fail. |
| 114 | + # Also, because we always push it, we intentionally do not tag it. |
| 115 | + # TODO: Move to separate workflow or job |
| 116 | + if: ${{ env.CONTAINER_IMAGE_GCC }} |
| 117 | + id: build-gcc |
| 118 | + uses: docker/build-push-action@v6 |
| 119 | + with: |
| 120 | + build-args: | |
| 121 | + BUILDKIT_DOCKERFILE_CHECK=skip=InvalidDefaultArgInFrom |
| 122 | + BUILDKIT_INLINE_CACHE=1 |
| 123 | + context: . |
| 124 | + file: docker/debian/Dockerfile.gcc-${{ matrix.os.compiler_version }}-${{ matrix.os.release }} |
| 125 | + outputs: type=image,name=${{ env.CONTAINER_IMAGE_GCC }},push-by-digest=true,name-canonical=true,push=true |
| 126 | + platforms: ${{ matrix.architecture.platform }} |
| 127 | + provenance: mode=max |
| 128 | + push: true |
| 129 | + sbom: true |
| 130 | + labels: ${{ steps.meta-gcc.outputs.labels }} |
99 | 131 | - name: Prepare container metadata |
100 | 132 | id: meta |
101 | 133 | uses: docker/metadata-action@v5 |
@@ -124,7 +156,7 @@ jobs: |
124 | 156 | GCOVR_VERSION=${{ env.GCOVR_VERSION }} |
125 | 157 | CMAKE_VERSION=${{ env.CMAKE_VERSION }} |
126 | 158 | DEBIAN_VERSION=${{ matrix.os.release }} |
127 | | - BASE_IMAGE=${{ env.CONTAINER_IMAGE_GCC && format('{0}:{1}-{2}', env.CONTAINER_IMAGE_GCC, matrix.os.compiler_version, matrix.os.release) || format('gcc:{0}-{1}', matrix.os.compiler_version, matrix.os.release) }} |
| 159 | + BASE_IMAGE=${{ env.CONTAINER_IMAGE_GCC && format('{0}@{1}', steps.build-gcc.outputs.digest) || format('gcc:{0}-{1}', matrix.os.compiler_version, matrix.os.release) }} |
128 | 160 | context: . |
129 | 161 | file: docker/debian/Dockerfile |
130 | 162 | outputs: type=image,name=${{ env.CONTAINER_IMAGE }},push-by-digest=true,name-canonical=true,push=true |
|
0 commit comments