4444fi
4545base_image=" ${base_image} cli-alpine"
4646dockerfile=" FROM ${base_image}
47- RUN apk add --update --no-cache bash coreutils git make openssh patch unzip zip"
47+ RUN apk add --update --no-cache bash coreutils git make openssh patch unzip zip
48+ # INI settings to set within Github Action's build runner
49+ RUN echo 'memory_limit=4G' > /usr/local/etc/php/conf.d/php-build.ini"
4850
4951base_repo=" $1 "
5052
7375done
7476dockerfile_unique=" ${dockerfile_unique} -${php_build_version} "
7577
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-
8478# Remove illegal characters and make lowercase:
8579GITHUB_REPOSITORY=" ${GITHUB_REPOSITORY,,} "
8680dockerfile_unique=" ${dockerfile_unique// / _} "
@@ -102,23 +96,24 @@ echo "$docker_tag" > ./docker_tag
10296echo " Pulling $docker_tag " >> output.log 2>&1
10397
10498# No need to continue building the image if the pull was successful.
105- if docker pull " $docker_tag " >> output.log 2>&1 ;
106- then
99+ if docker pull " $docker_tag " >> output.log 2>&1 ; then
107100 # Unless the PHP version has an update...
108101
109102 # Pull latest PHP Docker image so we can check its version.
110103 echo " Pulling $base_image " >> output.log 2>&1
111- docker pull " $base_image " >> output.log 2>&1
112-
113- # Check PHP versions of the latest PHP tag and our tag.
114- base_image_php_version=$( docker run -i " $base_image " php -r " echo PHP_VERSION;" )
115- cached_image_php_version=$( docker run -i " $docker_tag " php -r " echo PHP_VERSION;" )
116-
117- echo " Comparing $cached_image_php_version (cached) to $base_image_php_version (latest)." >> output.log 2>&1
118-
119- # No need to continue building if our image already exists and PHP is up-to-date.
120- if [ $cached_image_php_version == $base_image_php_version ];
121- then
104+ if docker pull " $base_image " >> output.log 2>&1 ; then
105+ # Check PHP versions of the latest PHP tag and our tag.
106+ base_image_php_version=$( docker run -i " $base_image " php -r " echo PHP_VERSION;" )
107+ cached_image_php_version=$( docker run -i " $docker_tag " php -r " echo PHP_VERSION;" )
108+
109+ echo " Comparing $cached_image_php_version (cached) to $base_image_php_version (latest)." >> output.log 2>&1
110+
111+ # No need to continue building if our image already exists and PHP is up-to-date.
112+ if [ $cached_image_php_version == $base_image_php_version ]; then
113+ exit
114+ fi
115+ else
116+ echo " Pulling from upstream failed, ignoring update check" >> output.log 2>&1
122117 exit
123118 fi
124119fi
0 commit comments