4040 tags : |
4141 ${{ env.IMAGE_BASE }}:base-pr-${{ github.event.pull_request.number }}
4242
43+ build_kaniko-sidecar :
44+ runs-on : ubuntu-latest
45+ needs : generate_infos
46+ steps :
47+ - name : Check out the repo
48+ uses : actions/checkout@v2
49+
50+ - name : Login to GitHub Container Registry
51+ uses : docker/login-action@v1
52+ with :
53+ registry : ghcr.io
54+ username : ${{ github.repository_owner }}
55+ password : ${{ secrets.GITHUB_TOKEN }}
56+
57+ - name : Set up QEMU
58+ uses : docker/setup-qemu-action@v1
59+ - name : Set up Docker Buildx
60+ id : buildx
61+ uses : docker/setup-buildx-action@v1
62+
4363 - name : Build github-actions-runner:kaniko-sidecar
4464 uses : docker/build-push-action@v2
4565 with :
@@ -48,24 +68,38 @@ jobs:
4868 tags : |
4969 ${{ env.IMAGE_BASE }}:kaniko-sidecar-pr-${{ github.event.pull_request.number }}
5070
71+ build_flavors :
72+ runs-on : ubuntu-latest
73+ needs : [generate_infos, build_base]
74+ strategy :
75+ matrix :
76+ flavor : [ansible-k8s, fullstacked]
77+ steps :
78+ - name : Check out the repo
79+ uses : actions/checkout@v2
80+
81+ - name : Login to GitHub Container Registry
82+ uses : docker/login-action@v1
83+ with :
84+ registry : ghcr.io
85+ username : ${{ github.repository_owner }}
86+ password : ${{ secrets.GITHUB_TOKEN }}
87+
88+ - name : Set up QEMU
89+ uses : docker/setup-qemu-action@v1
90+ - name : Set up Docker Buildx
91+ id : buildx
92+ uses : docker/setup-buildx-action@v1
93+
5194 - name : link child image to current pr
5295 run : |
5396 sed -i --expression "s@FROM ${{ env.IMAGE_BASE }}.*@FROM ${{ env.IMAGE_BASE }}:base-pr-${{ github.event.pull_request.number }}@g" \
54- images/ansible-k8s/Dockerfile \
55- images/fullstacked/Dockerfile
56-
57- - name : Build github-actions-runner:ansible-k8s
58- uses : docker/build-push-action@v2
59- with :
60- context : ./images/ansible-k8s
61- push : true
62- tags : |
63- ${{ env.IMAGE_BASE }}:ansible-k8s-pr-${{ github.event.pull_request.number }}
97+ images/${{ matrix.flavor }}/Dockerfile
6498
65- - name : Build github-actions-runner:fullstacked
99+ - name : Build github-actions-runner:${{ matrix.flavor }}
66100 uses : docker/build-push-action@v2
67101 with :
68- context : ./images/fullstacked
102+ context : ./images/${{ matrix.flavor }}
69103 push : true
70104 tags : |
71- ${{ env.IMAGE_BASE }}:fullstacked -pr-${{ github.event.pull_request.number }}
105+ ${{ env.IMAGE_BASE }}:${{ matrix.flavor }} -pr-${{ github.event.pull_request.number }}
0 commit comments