Skip to content

Commit

Permalink
Testing
Browse files Browse the repository at this point in the history
  • Loading branch information
enolfc committed Jul 11, 2023
1 parent 533a933 commit 159d6f0
Show file tree
Hide file tree
Showing 2 changed files with 27 additions and 17 deletions.
26 changes: 16 additions & 10 deletions .github/workflows/build-list.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,25 +32,31 @@ jobs:
- name: Check what needs to be built
id: build
run: |
set -x
read -r -a changes <<< "${{ steps.change-list.outputs.all_changed_files }}"
base="${{ inputs.base }}"
images=(${{ inputs.images }})
build_base=0
build_images=()
if [[ "$base" != "" && "${{ steps.change-list.outputs.all_changed_files }}" =~ $base ]]; then
build_base=1
if [[ "$base" != "" ]]; then
for c in "${changes[@]}"; do
if [[ "$c" == "$base" ]]; then
build_base=1
break
fi
done
fi
for img in "${images[@]}"; do
if [[ "$build_base" = 1 || \
"${{ steps.change-list.outputs.all_changed_files }}" =~ $img ]]; then
if [[ "$build_base" = 1 ]]; then
build_images+=("$(dirname "$img")")
continue
fi
for c in "${changes[@]}"; do
if [[ "$c" == "$img" ]]; then
build_images+=("$(dirname "$img")")
break
fi
done
done
if [[ -n "${build_images[*]}" ]]; then
build_base=1
Expand Down
18 changes: 11 additions & 7 deletions .github/workflows/sidecar.yml.no → .github/workflows/sidecar.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,18 +9,22 @@ on:
pull_request:

jobs:
detect-changes:
uses: ./.github/workflows/build-list.yml
with:
images: |
"d4science-storage/Dockerfile"
"oneclient-sidecar/Dockerfile"
"single-user-eiscat/Dockerfile"
"webdav-sidecar/Dockerfile"
sidecar-images:
name: Build and push independent images
needs: detect-changes
runs-on: ubuntu-latest

strategy:
matrix:
image:
- d4science-storage
- oneclient-sidecar
- single-user-eiscat
- webdav-sidecar

matrix: ${{ fromJson(needs.detect-changes.outputs.matrix) }}
steps:
- name: Checkout
uses: actions/checkout@v3
Expand Down

0 comments on commit 159d6f0

Please sign in to comment.