diff --git a/.github/actions/format-docker-build-args/action.yml b/.github/actions/format-docker-build-args/action.yml new file mode 100644 index 000000000000..6fa8e7ea22c5 --- /dev/null +++ b/.github/actions/format-docker-build-args/action.yml @@ -0,0 +1,34 @@ +name: "format-docker-build-args" +description: "Format the build args to work with the wretry.action" +inputs: + build-args: + description: "List of build-time variables." +outputs: + build-args: + description: "Build args formatted to work with the wretry.action" + value: ${{ steps.build-args.outputs.build-args }} +runs: + using: "composite" + steps: + - id: build-args + shell: python + run: | + import os + + # Adds two spaces to the line breaks to ensure proper indentation + # when passing the multi-line string to the wretry.action. + # Without it, the multi-line string is passed like this: + # + # build-args: | + # ARG1= + # ARG2= + # ARG3= + # + # This causes the Docker action to interpret ARG2 and ARG3 as keys instead + # of values ​​of the multi-line string. + build_args = '''${{ inputs.build-args }}'''.replace("\n", "\n ") + + with open(os.environ['GITHUB_OUTPUT'], 'a') as fh: + print("build-args<> "${PROJECT_DIR}/pyproject.toml" - [tool.flwr.federations.docker-compose-tls] - address = "127.0.0.1:9093" - root-certificates = "../superexec-certificates/ca.crt" - EOT - - flwr run e2e-compose docker-compose-tls - timeout 1000 docker compose logs -f superexec | grep -q 'Run finished' - - name: Login to Docker Hub uses: docker/login-action@9780b0c442fbb1117ed29e0efdff1e18412f7567 # v3.3.0 with: @@ -144,7 +95,7 @@ jobs: context: "{{defaultContext}}:${{ inputs.file-dir }}" outputs: type=image,name=${{ inputs.namespace-repository }},push-by-digest=true,name-canonical=true,push=true build-args: | - ${{ steps.build-id.outputs.build-args }} + ${{ steps.build-args.outputs.build-args }} - name: Export digest run: |