Nigthly #292
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Nigthly | |
on: | |
schedule: | |
- cron: '0 0 * * *' | |
jobs: | |
call-build: | |
uses: IndustryFusion/DigitalTwin/.github/workflows/build.yaml@main | |
call-test: | |
uses: IndustryFusion/DigitalTwin/.github/workflows/k8s-tests.yaml@main | |
push-images: | |
needs: call-test | |
runs-on: private | |
env: | |
DOCKER_USERNAME: ${{ secrets.DOCKER_USERNAME }} | |
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | |
DOCKER_PREFIX: ${{ secrets.DOCKER_PREFIX }} | |
SELF_HOSTED_RUNNER: true | |
steps: | |
- name: Push images | |
shell: bash | |
run: | | |
set +o pipefail | |
docker login -u "${DOCKER_USERNAME}" -p "${DOCKER_PASSWORD}" | |
TARGET_DOCKER_TAG=nightly-`date -I` | |
# Tag and push passed "k3d-iff.localhost:12345" non-scorpio related images as latest | |
images=$(docker images --format "{{.Repository}}:{{.Tag}}" | grep k3d-iff | grep -v none) | |
for image in ${images}; do | |
newimage=$(echo $image | sed -r "s/:0.1/:latest/g" | sed -r "s/k3d-iff.localhost:12345/${DOCKER_PREFIX}/g"); | |
docker tag ${image} ${newimage}; | |
docker push ${newimage}; | |
newimage=$(echo $image | sed -r "s/:0.1/:${TARGET_DOCKER_TAG}/g" | sed -r "s/k3d-iff.localhost:12345/${DOCKER_PREFIX}/g"); | |
docker tag ${image} ${newimage}; | |
docker push ${newimage}; | |
done | |
docker system prune -a -f | |