Skip to content

Commit bfebbf6

Browse files
committed
♻️ chore: add github action for 8.4
1 parent f660a8d commit bfebbf6

File tree

1 file changed

+113
-0
lines changed

1 file changed

+113
-0
lines changed

.github/workflows/ci-8.4.yml

Lines changed: 113 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,113 @@
1+
name: ci-8.4
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
8+
env:
9+
REGISTRY_IMAGE: ${{ github.actor }}/php-nginx
10+
11+
jobs:
12+
build:
13+
runs-on: ubuntu-latest
14+
strategy:
15+
fail-fast: false
16+
matrix:
17+
platform:
18+
- linux/amd64
19+
- linux/arm/v7
20+
- linux/arm/v8
21+
- linux/arm64
22+
steps:
23+
- name: Prepare
24+
run: |
25+
platform=${{ matrix.platform }}
26+
echo "PLATFORM_PAIR=8_4-${platform//\//-}" >> $GITHUB_ENV
27+
28+
- name: Checkout
29+
uses: actions/checkout@v4
30+
31+
- name: Docker meta
32+
id: meta
33+
uses: docker/metadata-action@v5
34+
with:
35+
images: ${{ env.REGISTRY_IMAGE }}
36+
tags: "8.4"
37+
38+
- name: Set up QEMU
39+
uses: docker/setup-qemu-action@v3
40+
41+
- name: Set up Docker Buildx
42+
uses: docker/setup-buildx-action@v3
43+
44+
- name: Login to Docker Hub
45+
uses: docker/login-action@v3
46+
with:
47+
username: ${{ github.actor }}
48+
password: ${{ secrets.DOCKERHUB_TOKEN }}
49+
50+
- name: Build and push by digest
51+
id: build
52+
uses: docker/build-push-action@v6
53+
with:
54+
context: .
55+
file: src/php/8.4/Dockerfile
56+
platforms: ${{ matrix.platform }}
57+
labels: ${{ steps.meta.outputs.labels }}
58+
outputs: type=image,name=${{ env.REGISTRY_IMAGE }},push-by-digest=true,name-canonical=true,push=true
59+
60+
- name: Export digest
61+
run: |
62+
mkdir -p /tmp/digests
63+
digest="${{ steps.build.outputs.digest }}"
64+
touch "/tmp/digests/${digest#sha256:}"
65+
66+
- name: Upload digest
67+
uses: actions/upload-artifact@v4
68+
with:
69+
name: digests-${{ env.PLATFORM_PAIR }}
70+
path: /tmp/digests/*
71+
if-no-files-found: error
72+
retention-days: 1
73+
74+
merge:
75+
runs-on: ubuntu-latest
76+
needs:
77+
- build
78+
steps:
79+
- name: Checkout
80+
uses: actions/checkout@v4
81+
82+
- name: Download digests
83+
uses: actions/download-artifact@v4
84+
with:
85+
path: /tmp/digests
86+
pattern: digests-*
87+
merge-multiple: true
88+
89+
- name: Set up Docker Buildx
90+
uses: docker/setup-buildx-action@v3
91+
92+
- name: Docker meta
93+
id: meta
94+
uses: docker/metadata-action@v5
95+
with:
96+
images: ${{ env.REGISTRY_IMAGE }}
97+
tags: "8.4"
98+
99+
- name: Login to Docker Hub
100+
uses: docker/login-action@v3
101+
with:
102+
username: ${{ github.actor }}
103+
password: ${{ secrets.DOCKERHUB_TOKEN }}
104+
105+
- name: Create manifest list and push
106+
working-directory: /tmp/digests
107+
run: |
108+
docker buildx imagetools create $(jq -cr '.tags | map("-t " + .) | join(" ")' <<< "$DOCKER_METADATA_OUTPUT_JSON") \
109+
$(printf '${{ env.REGISTRY_IMAGE }}@sha256:%s ' *)
110+
111+
- name: Inspect image
112+
run: |
113+
docker buildx imagetools inspect ${{ env.REGISTRY_IMAGE }}:${{ steps.meta.outputs.version }}

0 commit comments

Comments
 (0)