diff --git a/.github/workflows/image.yml b/.github/workflows/image.yml index a3594af..ec77b78 100644 --- a/.github/workflows/image.yml +++ b/.github/workflows/image.yml @@ -21,4 +21,4 @@ jobs: username: ${{ secrets.DOCKER_USERNAME }} password: ${{ secrets.DOCKER_PASSWORD }} - name: Build image - run: build/bin/build "5.4.2 5.5.1 5.5.3 5.6.0 5.6.1 5.7.0 5.8.0" \ No newline at end of file + run: build/bin/build "5.4.2 5.5.1 5.5.3 5.6.0 5.6.1 5.7.0 5.8.0" "5.8.0" \ No newline at end of file diff --git a/build/bin/build b/build/bin/build index 2bfb20f..641e392 100755 --- a/build/bin/build +++ b/build/bin/build @@ -1,6 +1,7 @@ #!/usr/bin/env sh WP_VERSIONS=${1:-""} +WP_LATEST_VERSION=${2:-""} if [ -z "${WP_VERSIONS}" ]; then echo "Error: WP_VERSIONS is null" @@ -10,9 +11,12 @@ fi docker buildx create --use --name build --node build --driver-opt network=host # Loop through requested versions -for TARGET_VERSION in ${WP_VERSIONS} -do +for TARGET_VERSION in ${WP_VERSIONS}; do echo "> Building WordPress ${TARGET_VERSION}" docker buildx build --pull --push --build-arg "WP_VERSION=${TARGET_VERSION}" --platform "linux/amd64,linux/armhf,linux/aarch64" --tag "nlss/wordpress:${TARGET_VERSION}" . -done \ No newline at end of file + + if [ "${TARGET_VERSION}" == "${WP_LATEST_VERSION}"]; then + docker buildx build --pull --push --build-arg "WP_VERSION=${TARGET_VERSION}" --platform "linux/amd64,linux/armhf,linux/aarch64" --tag "nlss/wordpress:latest" . + fi +done