feat: Added lab containers and improved pipeline to ensure base containers are built first
Some checks failed
Build and Push Dev Containers / build (push) Failing after 2m12s
Some checks failed
Build and Push Dev Containers / build (push) Failing after 2m12s
This commit is contained in:
@@ -24,8 +24,32 @@ jobs:
|
||||
|
||||
- name: Build and push containers
|
||||
run: |
|
||||
for dir in $(find . -type f -iname 'Dockerfile' -exec dirname {} \; | sed 's|^\./||'); do
|
||||
tag="${{ secrets.CONTAINER_REGISTRY }}/${{ secrets.CONTAINER_REGISTRY_USERNAME }}/$dir:latest"
|
||||
# ...existing code...
|
||||
set -euo pipefail
|
||||
|
||||
registry="${{ secrets.CONTAINER_REGISTRY }}"
|
||||
username="${{ secrets.CONTAINER_REGISTRY_USERNAME }}"
|
||||
|
||||
# Build 'base' and 'lab' groups first (including subdirectories)
|
||||
for group in base lab; do
|
||||
if [ -d "$group" ]; then
|
||||
echo "Processing group: $group"
|
||||
find "$group" -type f -iname 'Dockerfile' -exec dirname {} \; | sed 's|^\./||' | sort -u | while read -r dir; do
|
||||
tag="$registry/$username/$dir:latest"
|
||||
echo "Building $dir -> $tag"
|
||||
docker build -t "$tag" "$dir"
|
||||
docker push "$tag"
|
||||
done
|
||||
else
|
||||
echo "Skipping missing group: $group"
|
||||
fi
|
||||
done
|
||||
|
||||
# Then build everything else (exclude base and lab)
|
||||
echo "Processing remaining Dockerfiles"
|
||||
find . -type f -iname 'Dockerfile' -exec dirname {} \; | sed 's|^\./||' | sort -u | grep -Ev '^(base|lab)(/|$)' | while read -r dir; do
|
||||
tag="$registry/$username/$dir:latest"
|
||||
echo "Building $dir -> $tag"
|
||||
docker build -t "$tag" "$dir"
|
||||
docker push "$tag"
|
||||
done
|
||||
|
Reference in New Issue
Block a user