Skip to content

Commit 55363f5

Browse files
phlogistonjohnmergify[bot]
authored andcommitted
workflows: restructure the push job
Previously, the push job would wait for the builds and tests to finish, then it would *rebuild* all the images and then push the `latest` and `nightly` (unqualified) tags to our quay.io container repos. This change updates the push job so that it re-uses the image builds that have been built and tested by the previous jobs. It then re-applies missing tags and updates the repo base. Finally, it pushes both the unqualified and fully-qualified tags. Signed-off-by: John Mulligan <[email protected]>
1 parent 91eeb16 commit 55363f5

File tree

1 file changed

+65
-12
lines changed

1 file changed

+65
-12
lines changed

.github/workflows/container-image.yml

Lines changed: 65 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -228,20 +228,73 @@ jobs:
228228
- test-server
229229
- test-ad-server-kubernetes
230230
runs-on: ubuntu-latest
231+
env:
232+
REPO_BASE: quay.io/samba.org
231233
if: (github.event_name == 'push' || github.event_name == 'schedule') && github.repository == 'samba-in-kubernetes/samba-container'
232234
steps:
233235
- uses: actions/checkout@v3
234236
- name: log in to quay.io
235237
run: ${CONTAINER_CMD} login -u "${{ secrets.QUAY_USER }}" -p "${{ secrets.QUAY_PASS }}" quay.io
236-
- name: push server image
237-
run: make push-server
238-
- name: push ad-server image
239-
run: make push-ad-server
240-
- name: push client image
241-
run: make push-client
242-
- name: push toolbox image
243-
run: make push-toolbox
244-
- name: push nightly server image
245-
run: make push-nightly-server
246-
- name: push nightly ad server image
247-
run: make push-nightly-ad-server
238+
# pull in already built images we plan on pushing
239+
# (server images)
240+
- name: Fetch server default-fedora-amd64
241+
uses: ishworkh/[email protected]
242+
with:
243+
image: "samba-server:default-fedora-amd64"
244+
container_engine: ${{ env.CONTAINER_CMD }}
245+
- name: Fetch server nightly-fedora-amd64
246+
uses: ishworkh/[email protected]
247+
with:
248+
image: "samba-server:nightly-fedora-amd64"
249+
container_engine: ${{ env.CONTAINER_CMD }}
250+
# (ad server images)
251+
- name: Fetch ad-server default-fedora-amd64
252+
uses: ishworkh/[email protected]
253+
with:
254+
image: "samba-ad-server:default-fedora-amd64"
255+
container_engine: ${{ env.CONTAINER_CMD }}
256+
- name: Fetch ad-server nightly-fedora-amd64
257+
uses: ishworkh/[email protected]
258+
with:
259+
image: "samba-ad-server:nightly-fedora-amd64"
260+
container_engine: ${{ env.CONTAINER_CMD }}
261+
# (client images)
262+
- name: Fetch client default-fedora-amd64
263+
uses: ishworkh/[email protected]
264+
with:
265+
image: "samba-client:default-fedora-amd64"
266+
container_engine: ${{ env.CONTAINER_CMD }}
267+
# (toolbox images)
268+
- name: Fetch toolbox default-fedora-amd64
269+
uses: ishworkh/[email protected]
270+
with:
271+
image: "samba-toolbox:default-fedora-amd64"
272+
container_engine: ${{ env.CONTAINER_CMD }}
273+
# reapply missing tags
274+
- name: Retag images
275+
run: >
276+
./hack/build-image
277+
--retag
278+
--container-engine=${CONTAINER_CMD}
279+
--repo-base=${REPO_BASE}
280+
--no-distro-qualified
281+
-i samba-server:default-fedora-amd64
282+
-i samba-server:nightly-fedora-amd64
283+
-i samba-ad-server:default-fedora-amd64
284+
-i samba-ad-server:nightly-fedora-amd64
285+
-i samba-client:default-fedora-amd64
286+
-i samba-toolbox:default-fedora-amd64
287+
- name: Push images
288+
run: >
289+
./hack/build-image
290+
--push
291+
--container-engine=${CONTAINER_CMD}
292+
--verbose
293+
--push-state=exists
294+
--push-selected-tags=mixed
295+
-i ${REPO_BASE}/samba-server:default-fedora-amd64
296+
-i ${REPO_BASE}/samba-server:nightly-fedora-amd64
297+
-i ${REPO_BASE}/samba-ad-server:default-fedora-amd64
298+
-i ${REPO_BASE}/samba-ad-server:nightly-fedora-amd64
299+
-i ${REPO_BASE}/samba-client:default-fedora-amd64
300+
-i ${REPO_BASE}/samba-toolbox:default-fedora-amd64

0 commit comments

Comments
 (0)