ci: Push directly from build step

Refactor the workflows so that we can use build-push-action also for
publishing. This is a precondition for switching to buildx, needed for
multi-arch images.

The trick needed for this is using an environment variable to control
whether we should push when building the master branch, initializing it
according to the tag status.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
This commit is contained in:
Jan Kiszka
2021-01-02 18:50:34 +01:00
parent 2f60b982a7
commit c92d845639
4 changed files with 20 additions and 26 deletions

View File

@@ -57,17 +57,12 @@ jobs:
- name: Build kas image
uses: docker/build-push-action@v2
with:
tags: |
ghcr.io/siemens/kas/kas
ghcr.io/siemens/kas/kas:next
push: true
tags: ghcr.io/siemens/kas/kas:next
- name: Build kas-isar image
uses: docker/build-push-action@v2
with:
file: Dockerfile.isar
tags: |
ghcr.io/siemens/kas/kas-isar
ghcr.io/siemens/kas/kas-isar:next
- name: Push images
run: |
docker push ghcr.io/siemens/kas/kas:next
docker push ghcr.io/siemens/kas/kas-isar:next
build-args: KAS_TAG=next
push: true
tags: ghcr.io/siemens/kas/kas-isar:next