|
1 | 1 | #!/bin/bash
|
2 | 2 | set -e
|
3 | 3 |
|
4 |
| -php_build_version="build2.1.0" |
| 4 | +php_build_version="build2.1.1" |
5 | 5 |
|
6 | 6 | # Check for required variables:
|
7 | 7 | if [ "$#" -lt 1 ]; then
|
|
73 | 73 | done
|
74 | 74 | dockerfile_unique="${dockerfile_unique}-${php_build_version}"
|
75 | 75 |
|
| 76 | +dockerfile="${dockerfile} |
| 77 | +ADD ./php-build.ini /usr/local/etc/php/conf.d" |
| 78 | + |
| 79 | +cat > ./php-build.ini<< EOF |
| 80 | +;INI settings to set within Github Action's build runner |
| 81 | +memory_limit=4G |
| 82 | +EOF |
| 83 | + |
76 | 84 | # Remove illegal characters and make lowercase:
|
77 | 85 | GITHUB_REPOSITORY="${GITHUB_REPOSITORY,,}"
|
78 | 86 | dockerfile_unique="${dockerfile_unique// /_}"
|
@@ -105,9 +113,16 @@ echo "Building PHP $ACTION_PHP_VERSION with extensions: $ACTION_PHP_EXTENSIONS .
|
105 | 113 | # need to re-build, and the `docker build` step should use the cached layers of
|
106 | 114 | # what has just been pulled.
|
107 | 115 | echo "$dockerfile" > Dockerfile-php-build
|
108 |
| -echo "Dockerfile:" >> output.log 2>&1 |
109 |
| -echo "$dockerfile" >> output.log 2>&1 |
| 116 | +if [ ACTIONS_RUNNER_DEBUG = "true" ] |
| 117 | +then |
| 118 | + echo "Dockerfile:" |
| 119 | + echo "$dockerfile" |
| 120 | + echo docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . |
| 121 | + |
| 122 | +fi |
| 123 | + |
110 | 124 | docker build --tag "$docker_tag" --cache-from "$docker_tag" --file Dockerfile-php-build . >> output.log 2>&1
|
| 125 | + |
111 | 126 | # Update the user's repository with the customised docker image, ready for the
|
112 | 127 | # next Github Actions run.
|
113 | 128 | if ! docker push "$docker_tag" >> output.log 2>&1; then
|
|
0 commit comments