Skip to content

Commit

Permalink
correct usage of matrix parameter and also check for the platform
Browse files Browse the repository at this point in the history
  • Loading branch information
Taepper committed Nov 15, 2024
1 parent 328e3d4 commit fe62da9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 4 deletions.
11 changes: 8 additions & 3 deletions .github/workflows/dependencies.yml
Original file line number Diff line number Diff line change
Expand Up @@ -46,16 +46,21 @@ jobs:

- name: Check if image exists
run: |
EXISTS=$(docker manifest inspect ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:${{ env.DIR_HASH }} > /dev/null 2>&1 && echo "true" || echo "false")
echo "CACHE_HIT=$EXISTS" >> $GITHUB_ENV
if [[ $(docker manifest inspect ${{ env.DOCKER_DEPENDENCY_IMAGE_NAME }}:${{ env.DIR_HASH }} > /dev/null 2>&1 ]]; then
echo "Cache hit, do not require rebuild of this docker image. Retagging old image instead."
echo "CACHE_HIT=true" >> $GITHUB_ENV
else
echo "CACHE_HIT=false" >> $GITHUB_ENV
fi
- name: Determine platform build necessity
if: env.CACHE_HIT == 'false'
id: platform-check
run: |
if [[ "${{ matrix.platform }}" == "linux/amd64" || "${{ github.event_name }}" == "workflow_dispatch" || "${{ github.ref }}" == "refs/heads/main" ]]; then
echo "PLATFORM_BUILD=true" >> $GITHUB_ENV
else
echo "Skipping Platform Build for ${{ matrix.plaform }}"
echo "Skipping build for this platform"
echo "PLATFORM_BUILD=false" >> $GITHUB_ENV
fi
shell: bash
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/imageAndTests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ jobs:
strategy:
matrix:
args:
${{ contains(github.event_name, 'workflow_dispatch') || github.ref == 'refs/heads/main' ? ['linux/amd64', 'linux/arm64']: [ 'linux/amd64' ] }}
['linux/amd64', 'linux/arm64']
permissions:
packages: write
steps:
Expand Down

0 comments on commit fe62da9

Please sign in to comment.