|
14 | 14 | docker-config-path: source/ci/docker |
15 | 15 |
|
16 | 16 | jobs: |
17 | | - # Build the docker container images that we will use for our Linux |
18 | | - # builds. This will identify the last commit to the repository that |
19 | | - # updated the docker images, and try to download the image tagged with |
20 | | - # that sha. If it does not exist, we'll do a docker build and push |
21 | | - # the image up to GitHub Packages for the actual CI/CD runs. We tag |
22 | | - # with both the sha and "latest" so that the subsequent runs need not |
23 | | - # know the sha. Only do this on CI builds (when the event is a "push") |
24 | | - # because PR builds from forks lack permission to write packages. |
25 | 17 | containers: |
26 | | - strategy: |
27 | | - matrix: |
28 | | - container: |
29 | | - - name: xenial |
30 | | - - name: bionic |
31 | | - - name: focal |
32 | | - - name: docurium |
33 | | - - name: bionic-x86 |
34 | | - dockerfile: bionic |
35 | | - base: multiarch/ubuntu-core:x86-bionic |
36 | | - qemu: true |
37 | | - - name: bionic-arm32 |
38 | | - dockerfile: bionic |
39 | | - base: multiarch/ubuntu-core:armhf-bionic |
40 | | - qemu: true |
41 | | - - name: bionic-arm64 |
42 | | - dockerfile: bionic |
43 | | - base: multiarch/ubuntu-core:arm64-bionic |
44 | | - qemu: true |
45 | | - - name: centos7 |
46 | | - - name: centos8 |
47 | | - runs-on: ubuntu-latest |
48 | | - name: "Create container: ${{ matrix.container.name }}" |
49 | | - steps: |
50 | | - - name: Check out repository |
51 | | - uses: actions/checkout@v3 |
52 | | - with: |
53 | | - path: source |
54 | | - fetch-depth: 0 |
55 | | - if: github.event_name != 'pull_request' |
56 | | - - name: Setup QEMU |
57 | | - run: docker run --rm --privileged multiarch/qemu-user-static:register --reset |
58 | | - if: matrix.container.qemu == true |
59 | | - - name: Download existing container |
60 | | - run: | |
61 | | - "${{ github.workspace }}/source/ci/getcontainer.sh" "${{ matrix.container.name }}" "${{ matrix.container.dockerfile }}" |
62 | | - env: |
63 | | - DOCKER_REGISTRY: ${{ env.docker-registry }} |
64 | | - GITHUB_TOKEN: ${{ secrets.github_token }} |
65 | | - working-directory: ${{ env.docker-config-path }} |
66 | | - if: github.event_name != 'pull_request' |
67 | | - - name: Build and publish image |
68 | | - run: | |
69 | | - if [ "${{ matrix.container.base }}" != "" ]; then |
70 | | - BASE_ARG="--build-arg BASE=${{ matrix.container.base }}" |
71 | | - fi |
72 | | - docker build -t ${{ env.docker-registry-container-sha }} --build-arg UID=$(id -u) --build-arg GID=$(id -g) ${BASE_ARG} -f ${{ env.dockerfile }} . |
73 | | - docker tag ${{ env.docker-registry-container-sha }} ${{ env.docker-registry-container-latest }} |
74 | | - docker push ${{ env.docker-registry-container-sha }} |
75 | | - docker push ${{ env.docker-registry-container-latest }} |
76 | | - working-directory: ${{ env.docker-config-path }} |
77 | | - if: github.event_name != 'pull_request' && env.docker-container-exists != 'true' |
| 18 | + uses: ./.github/workflows/build-containers.yml |
78 | 19 |
|
79 | 20 | # Run our CI/CD builds. We build a matrix with the various build targets |
80 | 21 | # and their details. Then we build either in a docker container (Linux) |
|
0 commit comments