Skip to content

Commit

Permalink
ci: Use path-based git context
Browse files Browse the repository at this point in the history
This avoids redundant clones and gives more stable file permissions when
copying in during the container build. We just need to move the test
outputs outside of the git repo.

Signed-off-by: Jan Kiszka <[email protected]>
  • Loading branch information
jan-kiszka committed Mar 2, 2024
1 parent a0376fe commit e3f633a
Show file tree
Hide file tree
Showing 3 changed files with 14 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .github/workflows/master.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ jobs:
uses: docker/build-push-action@v5
if: ${{ env.PUSH_MASTER }}
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
Expand All @@ -40,6 +41,7 @@ jobs:
uses: docker/build-push-action@v5
if: ${{ env.PUSH_MASTER }}
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
target: kas-isar
Expand Down
12 changes: 10 additions & 2 deletions .github/workflows/next.yml
Original file line number Diff line number Diff line change
Expand Up @@ -76,17 +76,21 @@ jobs:
- name: Build kas image
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
load: true
tags: ghcr.io/siemens/kas/kas:next
- name: Test kas image
run: |
cd image-tests/poky
KAS_IMAGE_VERSION=next ../../kas-container build kas.yml
export KAS_IMAGE_VERSION=next
export KAS_WORK_DIR=~/poky-test
../../kas-container build kas.yml
- name: Complete build and deploy kas image
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
Expand All @@ -95,6 +99,7 @@ jobs:
- name: Build kas-isar image
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
target: kas-isar
Expand All @@ -103,10 +108,13 @@ jobs:
- name: Test kas-isar image
run: |
cd image-tests/isar
KAS_IMAGE_VERSION=next ../../kas-container build kas.yml
export KAS_IMAGE_VERSION=next
export KAS_WORK_DIR=~/isar-test
../../kas-container build kas.yml
- name: Complete build and deploy kas-isar image
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
target: kas-isar
Expand Down
2 changes: 2 additions & 0 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,7 @@ jobs:
- name: Build kas image
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
platforms: linux/amd64,linux/arm64
Expand All @@ -33,6 +34,7 @@ jobs:
- name: Build kas-isar image
uses: docker/build-push-action@v5
with:
context: .
cache-from: type=gha
cache-to: type=gha,mode=max
target: kas-isar
Expand Down

0 comments on commit e3f633a

Please sign in to comment.