@@ -81,15 +81,17 @@ jobs:
81
81
- name : Build and push ${{ matrix.php_version }}-${{ matrix.variant }} with tagged prefix
82
82
run : |
83
83
PHP_VERSION="${{ matrix.php_version }}"
84
+ mkdir -p /tmp/build-cache
84
85
TAG_PREFIX="rc${GITHUB_SHA::7}-" \
85
86
docker buildx bake \
86
87
--set "*.platform=linux/amd64,linux/arm64" \
88
+ --cache-to "type=local,mode=max,dest=/tmp/build-cache" \
87
89
--set "*.output=type=registry" \
88
90
php${PHP_VERSION//.}-${{ matrix.variant }}-all
89
91
- name : Fetch minor version of php
90
92
run : |
91
93
# Retrieve minor version
92
- PHP_PATCH_MINOR=`docker run --rm thecodingmachine/php:rc- ${GITHUB_SHA::7}-${{ matrix.php_version }}-v4-slim-${{ matrix.variant }} php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
94
+ PHP_PATCH_MINOR=`docker run --rm thecodingmachine/php:rc${GITHUB_SHA::7}-${{ matrix.php_version }}-v4-slim-${{ matrix.variant }} php -v | head -n1 | grep -P '\d+\.\d+\.\d+' -o | head -n1`
93
95
echo "PHP_PATCH_MINOR=${PHP_PATCH_MINOR}" >> $GITHUB_ENV
94
96
- name : Build and push ${{ matrix.php_version }}-${{ matrix.variant }} with releases tags (major and minor)
95
97
run : |
@@ -98,21 +100,23 @@ jobs:
98
100
docker buildx bake \
99
101
--set "*.platform=linux/amd64,linux/arm64" \
100
102
--set "*.output=type=registry" \
101
- --metadata-file "/tmp/digests-php${PHP_VERSION//.}-${{ matrix.variant }}.log"
103
+ --cache-to "type=local,mode=max,dest=/tmp/build-cache" \
104
+ --cache-from "type=local,mode=max,dest=/tmp/build-cache" \
105
+ --metadata-file "/tmp/digests.log"
102
106
php${PHP_VERSION//.}-${{ matrix.variant }}-all
103
- - name : Artifacts
104
- uses : actions/upload-artifact@v3
105
- with :
106
- name : digests-${{ matrix.php_version }}-${{ matrix.variant }}
107
- path : /tmp/digests-php${PHP_VERSION//.}-${{ matrix.variant }}.log
108
- retention-days : 60
109
107
- name : Display tags built
110
108
run : |
111
- echo "With prefix :"
109
+ echo "With prefix :" > "/tmp/tags.log"
112
110
TAG_PREFIX="rc${GITHUB_SHA::7}-" \
113
- docker buildx bake php${PHP_VERSION//.}-${{ matrix.variant }}-all --print --progress plain | jq ".target[].tags | join(\" \")" -r
114
- echo "-----"
115
- echo "Regular :"
111
+ docker buildx bake php${PHP_VERSION//.}-${{ matrix.variant }}-all --print --progress plain | jq ".target[].tags | join(\" \")" -r >> "/tmp/tags.log"
112
+ echo "-----" >> "/tmp/tags.log"
113
+ echo "Regular :" >> "/tmp/tags.log"
116
114
PHP_PATCH_MINOR="${PHP_VERSION_MINOR}" \
117
- docker buildx bake php${PHP_VERSION//.}-${{ matrix.variant }}-all --print --progress plain | jq ".target[].tags | join(\" \")" -r
118
-
115
+ docker buildx bake php${PHP_VERSION//.}-${{ matrix.variant }}-all --print --progress plain | jq ".target[].tags | join(\" \")" -r >> "/tmp/tags.log"
116
+ cat "/tmp/tags.log"
117
+ - name : Artifacts
118
+ uses : actions/upload-artifact@v3
119
+ with :
120
+ name : ${{ matrix.php_version }}-${{ matrix.variant }}-logs
121
+ path : /tmp/{digests,tag}.log
122
+ retention-days : 60
0 commit comments