Skip to content

Commit 0ff7b12

Browse files
committed
feat(ci): split workflows
1 parent cd679aa commit 0ff7b12

7 files changed

Lines changed: 283 additions & 122 deletions

File tree

Lines changed: 10 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,14 @@
11
# NOTE: This file was generated via generate.sh. Don't edit it directly
22

3-
name: Github CI
3+
name: 'PHP 7.4'
44

55
on:
66
pull_request:
7+
paths:
8+
- 7.4/**
79
push:
10+
paths:
11+
- 7.4/**
812

913
defaults:
1014
run:
@@ -31,30 +35,6 @@ jobs:
3135
matrix:
3236
target:
3337
[
34-
"8_1_11-cli-bullseye",
35-
"8_1_11-fpm-bullseye",
36-
"8_1_11-nginx-bullseye",
37-
"8_1_11-cli-buster",
38-
"8_1_11-fpm-buster",
39-
"8_1_11-nginx-buster",
40-
"8_1_11-cli-alpine3_16",
41-
"8_1_11-fpm-alpine3_16",
42-
"8_1_11-nginx-alpine3_16",
43-
"8_1_11-cli-alpine3_15",
44-
"8_1_11-fpm-alpine3_15",
45-
"8_1_11-nginx-alpine3_15",
46-
"8_0_24-cli-bullseye",
47-
"8_0_24-fpm-bullseye",
48-
"8_0_24-nginx-bullseye",
49-
"8_0_24-cli-buster",
50-
"8_0_24-fpm-buster",
51-
"8_0_24-nginx-buster",
52-
"8_0_24-cli-alpine3_16",
53-
"8_0_24-fpm-alpine3_16",
54-
"8_0_24-nginx-alpine3_16",
55-
"8_0_24-cli-alpine3_15",
56-
"8_0_24-fpm-alpine3_15",
57-
"8_0_24-nginx-alpine3_15",
5838
"7_4_32-cli-bullseye",
5939
"7_4_32-fpm-bullseye",
6040
"7_4_32-nginx-bullseye",
@@ -69,10 +49,10 @@ jobs:
6949
"7_4_32-nginx-alpine3_15",
7050
]
7151
env:
72-
ENABLE_DOCKERHUB: ${{ (secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN) && 'true' || 'false' }}
52+
DOCKER_HUB_PUSH: ${{ (secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN) && 'true' || 'false' }}
7353
steps:
7454
- name: Checkout
75-
uses: actions/checkout@v2
55+
uses: actions/checkout@v3
7656
- name: Set up QEMU
7757
uses: docker/setup-qemu-action@v2
7858
with:
@@ -81,12 +61,12 @@ jobs:
8161
uses: docker/setup-buildx-action@v1
8262
with:
8363
version: v0.7.0
84-
- name: Login to DockerHub
64+
- name: Login to Docker Hub
8565
uses: docker/login-action@v2
8666
with:
8767
username: ${{ secrets.DOCKERHUB_USERNAME }}
8868
password: ${{ secrets.DOCKERHUB_TOKEN }}
89-
if: ${{ env.ENABLE_DOCKERHUB == 'true' }}
69+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
9070
- name: Login to GitHub Container Registry
9171
uses: docker/login-action@v2
9272
with:
@@ -100,7 +80,7 @@ jobs:
10080
set: |
10181
*.platform=linux/amd64,linux/arm,linux/arm64
10282
push: ${{ github.event_name == 'push' }}
103-
if: ${{ env.ENABLE_DOCKERHUB == 'true' }}
83+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
10484
- name: Build and push to GitHub Container Registry
10585
uses: docker/bake-action@v2
10686
env:

.github/workflows/8.0.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# NOTE: This file was generated via generate.sh. Don't edit it directly
2+
3+
name: 'PHP 8.0'
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- 8.0/**
9+
push:
10+
paths:
11+
- 8.0/**
12+
13+
defaults:
14+
run:
15+
shell: 'bash -Eeuo pipefail -x {0}'
16+
17+
jobs:
18+
verify-templating:
19+
name: Verify templating
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Generate
24+
run: make all
25+
- name: Check Git status
26+
run: |
27+
test -z "$(git status --short)"
28+
29+
docker:
30+
name: ${{ matrix.target }}
31+
runs-on: ubuntu-latest
32+
needs:
33+
- verify-templating
34+
strategy:
35+
matrix:
36+
target:
37+
[
38+
"8_0_24-cli-bullseye",
39+
"8_0_24-fpm-bullseye",
40+
"8_0_24-nginx-bullseye",
41+
"8_0_24-cli-buster",
42+
"8_0_24-fpm-buster",
43+
"8_0_24-nginx-buster",
44+
"8_0_24-cli-alpine3_16",
45+
"8_0_24-fpm-alpine3_16",
46+
"8_0_24-nginx-alpine3_16",
47+
"8_0_24-cli-alpine3_15",
48+
"8_0_24-fpm-alpine3_15",
49+
"8_0_24-nginx-alpine3_15",
50+
]
51+
env:
52+
DOCKER_HUB_PUSH: ${{ (secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN) && 'true' || 'false' }}
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v3
56+
- name: Set up QEMU
57+
uses: docker/setup-qemu-action@v2
58+
with:
59+
platforms: arm,arm64
60+
- name: Set up buildx
61+
uses: docker/setup-buildx-action@v1
62+
with:
63+
version: v0.7.0
64+
- name: Login to Docker Hub
65+
uses: docker/login-action@v2
66+
with:
67+
username: ${{ secrets.DOCKERHUB_USERNAME }}
68+
password: ${{ secrets.DOCKERHUB_TOKEN }}
69+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
70+
- name: Login to GitHub Container Registry
71+
uses: docker/login-action@v2
72+
with:
73+
registry: ghcr.io
74+
username: ${{ github.repository_owner }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
76+
- name: Build and push to DockerHub
77+
uses: docker/bake-action@v2
78+
with:
79+
targets: ${{ matrix.target }}
80+
set: |
81+
*.platform=linux/amd64,linux/arm,linux/arm64
82+
push: ${{ github.event_name == 'push' }}
83+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
84+
- name: Build and push to GitHub Container Registry
85+
uses: docker/bake-action@v2
86+
env:
87+
REGISTRY: ghcr.io
88+
REPO: ${{ github.repository_owner }}/php
89+
with:
90+
targets: ${{ matrix.target }}
91+
set: |
92+
*.platform=linux/amd64,linux/arm,linux/arm64
93+
push: ${{ github.event_name == 'push' }}

.github/workflows/8.1.yml

Lines changed: 93 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,93 @@
1+
# NOTE: This file was generated via generate.sh. Don't edit it directly
2+
3+
name: 'PHP 8.1'
4+
5+
on:
6+
pull_request:
7+
paths:
8+
- 8.1/**
9+
push:
10+
paths:
11+
- 8.1/**
12+
13+
defaults:
14+
run:
15+
shell: 'bash -Eeuo pipefail -x {0}'
16+
17+
jobs:
18+
verify-templating:
19+
name: Verify templating
20+
runs-on: ubuntu-latest
21+
steps:
22+
- uses: actions/checkout@v2
23+
- name: Generate
24+
run: make all
25+
- name: Check Git status
26+
run: |
27+
test -z "$(git status --short)"
28+
29+
docker:
30+
name: ${{ matrix.target }}
31+
runs-on: ubuntu-latest
32+
needs:
33+
- verify-templating
34+
strategy:
35+
matrix:
36+
target:
37+
[
38+
"8_1_11-cli-bullseye",
39+
"8_1_11-fpm-bullseye",
40+
"8_1_11-nginx-bullseye",
41+
"8_1_11-cli-buster",
42+
"8_1_11-fpm-buster",
43+
"8_1_11-nginx-buster",
44+
"8_1_11-cli-alpine3_16",
45+
"8_1_11-fpm-alpine3_16",
46+
"8_1_11-nginx-alpine3_16",
47+
"8_1_11-cli-alpine3_15",
48+
"8_1_11-fpm-alpine3_15",
49+
"8_1_11-nginx-alpine3_15",
50+
]
51+
env:
52+
DOCKER_HUB_PUSH: ${{ (secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN) && 'true' || 'false' }}
53+
steps:
54+
- name: Checkout
55+
uses: actions/checkout@v3
56+
- name: Set up QEMU
57+
uses: docker/setup-qemu-action@v2
58+
with:
59+
platforms: arm,arm64
60+
- name: Set up buildx
61+
uses: docker/setup-buildx-action@v1
62+
with:
63+
version: v0.7.0
64+
- name: Login to Docker Hub
65+
uses: docker/login-action@v2
66+
with:
67+
username: ${{ secrets.DOCKERHUB_USERNAME }}
68+
password: ${{ secrets.DOCKERHUB_TOKEN }}
69+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
70+
- name: Login to GitHub Container Registry
71+
uses: docker/login-action@v2
72+
with:
73+
registry: ghcr.io
74+
username: ${{ github.repository_owner }}
75+
password: ${{ secrets.GITHUB_TOKEN }}
76+
- name: Build and push to DockerHub
77+
uses: docker/bake-action@v2
78+
with:
79+
targets: ${{ matrix.target }}
80+
set: |
81+
*.platform=linux/amd64,linux/arm,linux/arm64
82+
push: ${{ github.event_name == 'push' }}
83+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
84+
- name: Build and push to GitHub Container Registry
85+
uses: docker/bake-action@v2
86+
env:
87+
REGISTRY: ghcr.io
88+
REPO: ${{ github.repository_owner }}/php
89+
with:
90+
targets: ${{ matrix.target }}
91+
set: |
92+
*.platform=linux/amd64,linux/arm,linux/arm64
93+
push: ${{ github.event_name == 'push' }}

ci.yml.template

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
name: Github CI
1+
name: 'PHP {{ php_minor }}'
22

33
on:
44
pull_request:
5+
paths:
6+
- {{ php_minor }}/**
57
push:
8+
paths:
9+
- {{ php_minor }}/**
610

711
defaults:
812
run:
@@ -30,10 +34,10 @@ jobs:
3034
target:
3135
{{ targets }}
3236
env:
33-
ENABLE_DOCKERHUB: ${{ (secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN) && 'true' || 'false' }}
37+
DOCKER_HUB_PUSH: ${{ (secrets.DOCKERHUB_USERNAME && secrets.DOCKERHUB_TOKEN) && 'true' || 'false' }}
3438
steps:
3539
- name: Checkout
36-
uses: actions/checkout@v2
40+
uses: actions/checkout@v3
3741
- name: Set up QEMU
3842
uses: docker/setup-qemu-action@v2
3943
with:
@@ -42,12 +46,12 @@ jobs:
4246
uses: docker/setup-buildx-action@v1
4347
with:
4448
version: v0.7.0
45-
- name: Login to DockerHub
49+
- name: Login to Docker Hub
4650
uses: docker/login-action@v2
4751
with:
4852
username: ${{ secrets.DOCKERHUB_USERNAME }}
4953
password: ${{ secrets.DOCKERHUB_TOKEN }}
50-
if: ${{ env.ENABLE_DOCKERHUB == 'true' }}
54+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
5155
- name: Login to GitHub Container Registry
5256
uses: docker/login-action@v2
5357
with:
@@ -61,7 +65,7 @@ jobs:
6165
set: |
6266
*.platform={{ platforms }}
6367
push: ${{ github.event_name == 'push' }}
64-
if: ${{ env.ENABLE_DOCKERHUB == 'true' }}
68+
if: ${{ env.DOCKER_HUB_PUSH == 'true' }}
6569
- name: Build and push to GitHub Container Registry
6670
uses: docker/bake-action@v2
6771
env:

0 commit comments

Comments
 (0)