Skip to content

[Patchabot] upgrade akeneo/pim-community-dev to v20230525155706 from github #1289

[Patchabot] upgrade akeneo/pim-community-dev to v20230525155706 from github

[Patchabot] upgrade akeneo/pim-community-dev to v20230525155706 from github #1289

Workflow file for this run

name: Build Updated Docker Images
on:
workflow_dispatch:
inputs:
logLevel:
description: 'reason'
required: true
default: ''
tags:
description: 'forced manual rebuild'
pull_request:
paths:
- '**/Dockerfile'
push:
branches:
- main
paths:
- '**/Dockerfile'
jobs:
provide_images_json:
# see json juggling: https://docs.github.com/en/free-pro-team@latest/actions/reference/context-and-expression-syntax-for-github-actions#example-6
# see https://stackoverflow.com/a/62953566/1348344
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
with:
fetch-depth: 0
# comparing HEAD^ to HEAD works because previous action merges master into the PR branch
- name: get docker json list
id: output_data
run: |
echo FOUND UPDATED DOCKERFILES TO BUILD
git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r HEAD^ HEAD | grep Dockerfile$
echo "::set-output name=matrix::$(python -c 'import json, sys; print(json.dumps([v for v in sys.argv[1:]]))' $(git diff-tree --no-commit-id --name-only --diff-filter=ACMRT -r HEAD^ HEAD | grep Dockerfile$))"
# this step is needed, so the output gets to the next defined job
outputs:
matrix: ${{ steps.output_data.outputs.matrix }}
build_and_push:
needs: provide_images_json
runs-on: ubuntu-latest
strategy:
fail-fast: true
matrix:
dockerfile: ${{fromJson(needs.provide_images_json.outputs.matrix)}}
if: >
!contains(github.event.head_commit.message, 'ci skip') &&
!contains(github.event.pull_request.title, 'ci skip')
steps:
- name: Clone Main Repo
uses: actions/checkout@v2
with:
fetch-depth: 0
- name: Build Docker Images
run: |
curl -LO https://storage.googleapis.com/container-structure-test/latest/container-structure-test-linux-amd64 && chmod +x container-structure-test-linux-amd64 && sudo mv container-structure-test-linux-amd64 /usr/local/bin/container-structure-test
fullDockerfilePath=${{ matrix.dockerfile }}
folder=${fullDockerfilePath%"/Dockerfile"}
TMP_IMAGE_ARRAY=($(echo $folder | tr "/" "\n"))
IMAGE_NAME=${TMP_IMAGE_ARRAY[0]}
TAG=${TMP_IMAGE_ARRAY[1]}
export REGISTRY_TARGET=${{ secrets.AKT_ENG_REGISTRY_DOMAIN }} && ./build.sh --lint=true --test=true --image=$IMAGE_NAME --tag=$TAG
- name: Login to target registry
if: github.ref == 'refs/heads/main'
uses: docker/login-action@v1
with:
registry: https://eu.gcr.io
username: _json_key
password: ${{ secrets.AKT_ENG_REGISTRY_PUBLIC_JSON }}
- name: Push images to GoogleContainerRegistry
if: github.ref == 'refs/heads/main'
run: docker images --format "{{.Repository}}:{{.Tag}}" | grep ${{ secrets.AKT_ENG_REGISTRY_DOMAIN }} | xargs -n 1 docker push