Skip to content

Commit cbf5190

Browse files
committed
⚡️ IMPROVE: update workflows script
1 parent 957fc3e commit cbf5190

File tree

5 files changed

+130
-35
lines changed

5 files changed

+130
-35
lines changed

.github/workflows/ci-7.4.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ci-7.4
33
on:
44
push:
55
branches:
6-
- "main"
6+
- main
77

88
env:
99
REGISTRY_IMAGE: ${{ github.actor }}/php-nginx
@@ -20,43 +20,53 @@ jobs:
2020
- linux/arm/v8
2121
- linux/arm64
2222
steps:
23+
- name: Prepare
24+
run: |
25+
platform=${{ matrix.platform }}
26+
echo "PLATFORM_PAIR=7_4-${platform//\//-}" >> $GITHUB_ENV
27+
2328
- name: Checkout
2429
uses: actions/checkout@v4
30+
2531
- name: Docker meta
2632
id: meta
2733
uses: docker/metadata-action@v5
2834
with:
2935
images: ${{ env.REGISTRY_IMAGE }}
3036
tags: "7.4"
37+
3138
- name: Set up QEMU
3239
uses: docker/setup-qemu-action@v3
40+
3341
- name: Set up Docker Buildx
3442
uses: docker/setup-buildx-action@v3
43+
3544
- name: Login to Docker Hub
3645
uses: docker/login-action@v3
3746
with:
3847
username: ${{ github.actor }}
3948
password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
4050
- name: Build and push by digest
4151
id: build
42-
uses: docker/build-push-action@v5
52+
uses: docker/build-push-action@v6
4353
with:
4454
context: .
4555
file: src/php/7.4/Dockerfile
4656
platforms: ${{ matrix.platform }}
4757
labels: ${{ steps.meta.outputs.labels }}
48-
provenance: true
49-
sbom: true
5058
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
59+
5160
- name: Export digest
5261
run: |
5362
mkdir -p /tmp/digests
5463
digest="${{ steps.build.outputs.digest }}"
55-
touch "/tmp/digests/7_4-${digest#sha256:}"
64+
touch "/tmp/digests/${digest#sha256:}"
65+
5666
- name: Upload digest
5767
uses: actions/upload-artifact@v4
5868
with:
59-
name: digests
69+
name: digests-${{ env.PLATFORM_PAIR }}
6070
path: /tmp/digests/*
6171
if-no-files-found: error
6272
retention-days: 1
@@ -66,29 +76,38 @@ jobs:
6676
needs:
6777
- build
6878
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
6982
- name: Download digests
7083
uses: actions/download-artifact@v4
7184
with:
72-
name: digests
7385
path: /tmp/digests
86+
pattern: digests-*
87+
merge-multiple: true
88+
7489
- name: Set up Docker Buildx
7590
uses: docker/setup-buildx-action@v3
91+
7692
- name: Docker meta
7793
id: meta
7894
uses: docker/metadata-action@v5
7995
with:
8096
images: ${{ env.REGISTRY_IMAGE }}
8197
tags: "7.4"
98+
8299
- name: Login to Docker Hub
83100
uses: docker/login-action@v3
84101
with:
85102
username: ${{ github.actor }}
86103
password: ${{ secrets.DOCKERHUB_TOKEN }}
104+
87105
- name: Create manifest list and push
88106
working-directory: /tmp/digests
89107
run: |
90108
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
91109
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
110+
92111
- name: Inspect image
93112
run: |
94113
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

.github/workflows/ci-8.1.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ci-8.1
33
on:
44
push:
55
branches:
6-
- "main"
6+
- main
77

88
env:
99
REGISTRY_IMAGE: ${{ github.actor }}/php-nginx
@@ -20,43 +20,53 @@ jobs:
2020
- linux/arm/v8
2121
- linux/arm64
2222
steps:
23+
- name: Prepare
24+
run: |
25+
platform=${{ matrix.platform }}
26+
echo "PLATFORM_PAIR=8_1-${platform//\//-}" >> $GITHUB_ENV
27+
2328
- name: Checkout
2429
uses: actions/checkout@v4
30+
2531
- name: Docker meta
2632
id: meta
2733
uses: docker/metadata-action@v5
2834
with:
2935
images: ${{ env.REGISTRY_IMAGE }}
3036
tags: "8.1"
37+
3138
- name: Set up QEMU
3239
uses: docker/setup-qemu-action@v3
40+
3341
- name: Set up Docker Buildx
3442
uses: docker/setup-buildx-action@v3
43+
3544
- name: Login to Docker Hub
3645
uses: docker/login-action@v3
3746
with:
3847
username: ${{ github.actor }}
3948
password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
4050
- name: Build and push by digest
4151
id: build
42-
uses: docker/build-push-action@v5
52+
uses: docker/build-push-action@v6
4353
with:
4454
context: .
4555
file: src/php/8.1/Dockerfile
4656
platforms: ${{ matrix.platform }}
4757
labels: ${{ steps.meta.outputs.labels }}
48-
provenance: true
49-
sbom: true
5058
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
59+
5160
- name: Export digest
5261
run: |
5362
mkdir -p /tmp/digests
5463
digest="${{ steps.build.outputs.digest }}"
55-
touch "/tmp/digests/8_1-${digest#sha256:}"
64+
touch "/tmp/digests/${digest#sha256:}"
65+
5666
- name: Upload digest
5767
uses: actions/upload-artifact@v4
5868
with:
59-
name: digests
69+
name: digests-${{ env.PLATFORM_PAIR }}
6070
path: /tmp/digests/*
6171
if-no-files-found: error
6272
retention-days: 1
@@ -66,29 +76,38 @@ jobs:
6676
needs:
6777
- build
6878
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
6982
- name: Download digests
7083
uses: actions/download-artifact@v4
7184
with:
72-
name: digests
7385
path: /tmp/digests
86+
pattern: digests-*
87+
merge-multiple: true
88+
7489
- name: Set up Docker Buildx
7590
uses: docker/setup-buildx-action@v3
91+
7692
- name: Docker meta
7793
id: meta
7894
uses: docker/metadata-action@v5
7995
with:
8096
images: ${{ env.REGISTRY_IMAGE }}
8197
tags: "8.1"
98+
8299
- name: Login to Docker Hub
83100
uses: docker/login-action@v3
84101
with:
85102
username: ${{ github.actor }}
86103
password: ${{ secrets.DOCKERHUB_TOKEN }}
104+
87105
- name: Create manifest list and push
88106
working-directory: /tmp/digests
89107
run: |
90108
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
91109
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
110+
92111
- name: Inspect image
93112
run: |
94113
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

.github/workflows/ci-8.2.yml

Lines changed: 26 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ name: ci-8.2
33
on:
44
push:
55
branches:
6-
- "main"
6+
- main
77

88
env:
99
REGISTRY_IMAGE: ${{ github.actor }}/php-nginx
@@ -20,43 +20,53 @@ jobs:
2020
- linux/arm/v8
2121
- linux/arm64
2222
steps:
23+
- name: Prepare
24+
run: |
25+
platform=${{ matrix.platform }}
26+
echo "PLATFORM_PAIR=8_2-${platform//\//-}" >> $GITHUB_ENV
27+
2328
- name: Checkout
2429
uses: actions/checkout@v4
30+
2531
- name: Docker meta
2632
id: meta
2733
uses: docker/metadata-action@v5
2834
with:
2935
images: ${{ env.REGISTRY_IMAGE }}
3036
tags: "8.2"
37+
3138
- name: Set up QEMU
3239
uses: docker/setup-qemu-action@v3
40+
3341
- name: Set up Docker Buildx
3442
uses: docker/setup-buildx-action@v3
43+
3544
- name: Login to Docker Hub
3645
uses: docker/login-action@v3
3746
with:
3847
username: ${{ github.actor }}
3948
password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
4050
- name: Build and push by digest
4151
id: build
42-
uses: docker/build-push-action@v5
52+
uses: docker/build-push-action@v6
4353
with:
4454
context: .
4555
file: src/php/8.2/Dockerfile
4656
platforms: ${{ matrix.platform }}
4757
labels: ${{ steps.meta.outputs.labels }}
48-
provenance: true
49-
sbom: true
5058
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
59+
5160
- name: Export digest
5261
run: |
5362
mkdir -p /tmp/digests
5463
digest="${{ steps.build.outputs.digest }}"
55-
touch "/tmp/digests/8_2-${digest#sha256:}"
64+
touch "/tmp/digests/${digest#sha256:}"
65+
5666
- name: Upload digest
5767
uses: actions/upload-artifact@v4
5868
with:
59-
name: digests
69+
name: digests-${{ env.PLATFORM_PAIR }}
6070
path: /tmp/digests/*
6171
if-no-files-found: error
6272
retention-days: 1
@@ -66,29 +76,38 @@ jobs:
6676
needs:
6777
- build
6878
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
6982
- name: Download digests
7083
uses: actions/download-artifact@v4
7184
with:
72-
name: digests
7385
path: /tmp/digests
86+
pattern: digests-*
87+
merge-multiple: true
88+
7489
- name: Set up Docker Buildx
7590
uses: docker/setup-buildx-action@v3
91+
7692
- name: Docker meta
7793
id: meta
7894
uses: docker/metadata-action@v5
7995
with:
8096
images: ${{ env.REGISTRY_IMAGE }}
8197
tags: "8.2"
98+
8299
- name: Login to Docker Hub
83100
uses: docker/login-action@v3
84101
with:
85102
username: ${{ github.actor }}
86103
password: ${{ secrets.DOCKERHUB_TOKEN }}
104+
87105
- name: Create manifest list and push
88106
working-directory: /tmp/digests
89107
run: |
90108
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
91109
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
110+
92111
- name: Inspect image
93112
run: |
94113
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)