Skip to content

global base image update (#39) #145

global base image update (#39)

global base image update (#39) #145

Workflow file for this run

name: Build and Push Docker Images
on:
push:
paths:
- "images/**/Dockerfile"
- "images/**/*"
- ".github/workflows/build_images.yaml"
workflow_dispatch:
jobs:
detect-changes:
runs-on: ubuntu-latest
outputs:
images: ${{ steps.changed_dirs.outputs.dirs }}
steps:
- name: Checkout code
uses: actions/checkout@v1
- name: Get changed directories
id: changed_dirs
run: |
changed_dirs=$(git diff --name-only --diff-filter=d ${{ github.event.before }} ${{ github.sha }} | grep '^images/' | awk -F/ '{print $2}' | uniq | sed 's/^/"/;s/$/",/')
changed_dirs=$(echo $changed_dirs | tr -d '\n')
echo "dirs=[ $changed_dirs ]"
echo "dirs=[$changed_dirs]" >> $GITHUB_OUTPUT
build-and-push-images:
needs: detect-changes
if: ${{ needs.detect-changes.outputs.images != '[]' || contains(github.event_name, 'workflow_dispatch') }}
strategy:
matrix:
image: ${{fromJson(needs.detect-changes.outputs.images)}}
uses: ./.github/workflows/reusable-docker-build-push.yml
with:
image: ${{ matrix.image }}
folder: images/${{ matrix.image }}
#pull-to-harbor:
# needs: [build-and-push-images, detect-changes]
# if: ${{ needs.detect-changes.outputs.images != '[]' || contains(github.event_name, 'workflow_dispatch') }}
# runs-on: ubuntu-latest
# strategy:
# matrix:
# image: ${{fromJson(needs.detect-changes.outputs.images)}}
# steps:
# - name: pull
# run: |
# openssl s_client -showcerts -connect harbor.ki.fh-swf.de:443 < /dev/null | sed -ne '/-BEGIN CERTIFICATE-/,/-END CERTIFICATE-/p' > /tmp/ca.crt
# sudo cp /tmp/ca.crt /usr/local/share/ca-certificates/
# sudo update-ca-certificates
# tag=$(echo "${{ matrix.image }}" | grep sha | head -n 1 | awk -F ':' '{print $2}')
# docker image pull harbor.ki.fh-swf.de/ghcr.io/fhswf/jupyterhub-k8s/${{ matrix.image }}:$tag