Skip to content

Commit

Permalink
WIP: ci: Switch to reproducible container build
Browse files Browse the repository at this point in the history
  • Loading branch information
jan-kiszka committed Feb 25, 2024
1 parent 74af1b0 commit fe7443c
Show file tree
Hide file tree
Showing 2 changed files with 28 additions and 43 deletions.
33 changes: 15 additions & 18 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,30 +18,27 @@ jobs:
run: |
# The release workflow will push :latest for tagged revisions
if git describe --exact-match --tags --match '*.*'; then
echo "PUSH_MASTER=false" >> $GITHUB_ENV
echo "NO_RELEASE=false" >> $GITHUB_ENV
else
echo "PUSH_MASTER=true" >> $GITHUB_ENV
echo "NO_RELEASE=true" >> $GITHUB_ENV
fi
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ secrets.PACKAGE_DEPLOY_USER }}
password: ${{ secrets.PACKAGE_DEPLOY_TOKEN }}
- name: Build kas image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
push: ${{ env.PUSH_MASTER }}
tags: ghcr.io/siemens/kas/kas
if: ${{ env.NO_RELEASE }}
run: |
scripts/build-container.sh --target kas --tag latest
podman push ghcr.io/siemens/kas/kas:latest
scripts/build-container.sh --target kas --tag latest --arch arm64
podman push ghcr.io/siemens/kas/kas:latest
- name: Build kas-isar image
uses: docker/build-push-action@v5
with:
target: kas-isar
platforms: linux/amd64,linux/arm64
push: ${{ env.PUSH_MASTER }}
tags: ghcr.io/siemens/kas/kas-isar
if: ${{ env.NO_RELEASE }}
run: |
scripts/build-container.sh --target kas-isar --tag latest
podman push ghcr.io/siemens/kas/kas-isar:latest
scripts/build-container.sh --target kas-isar --tag latest --arch arm64
podman push ghcr.io/siemens/kas/kas-isar:latest
38 changes: 13 additions & 25 deletions .github/workflows/next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -68,45 +68,33 @@ jobs:
steps:
- name: Check out repo
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to ghcr.io
uses: docker/login-action@v3
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ secrets.PACKAGE_DEPLOY_USER }}
password: ${{ secrets.PACKAGE_DEPLOY_TOKEN }}
- name: Build kas image
uses: docker/build-push-action@v5
with:
load: true
tags: ghcr.io/siemens/kas/kas:next
run: |
scripts/build-container.sh --target kas
- name: Test kas image
run: |
cd image-tests/poky
KAS_IMAGE_VERSION=next ../../kas-container build kas.yml
- name: Complete build and deploy kas image
uses: docker/build-push-action@v5
with:
platforms: linux/amd64,linux/arm64
tags: ghcr.io/siemens/kas/kas:next
push: true
run: |
podman push ghcr.io/siemens/kas/kas:next
scripts/build-container.sh --target kas --arch arm64
podman push ghcr.io/siemens/kas/kas:next
- name: Build kas-isar image
uses: docker/build-push-action@v5
with:
target: kas-isar
load: true
tags: ghcr.io/siemens/kas/kas-isar:next
run: |
scripts/build-container.sh --target kas-isar
- name: Test kas-isar image
run: |
cd image-tests/isar
KAS_IMAGE_VERSION=next ../../kas-container build kas.yml
- name: Complete build and deploy kas-isar image
uses: docker/build-push-action@v5
with:
target: kas-isar
platforms: linux/amd64,linux/arm64
tags: ghcr.io/siemens/kas/kas-isar:next
push: true
run: |
podman push ghcr.io/siemens/kas/kas-isar:next
scripts/build-container.sh --target kas-isar --arch arm64
podman push ghcr.io/siemens/kas/kas-isar:next

0 comments on commit fe7443c

Please sign in to comment.