Skip to content

Commit c10bf64

Browse files
committed
feat: parallelize php7/php8 container builds
1 parent 740ed15 commit c10bf64

1 file changed

Lines changed: 33 additions & 1 deletion

File tree

.github/workflows/production.yml

Lines changed: 33 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ on:
99
- cron: 00 4 * * *
1010

1111
jobs:
12-
ghcr:
12+
php7:
1313
runs-on: ubuntu-latest
1414

1515
steps:
@@ -63,6 +63,24 @@ jobs:
6363
- name: Push with commit php7-review tag
6464
run: docker push ghcr.io/${{ github.repository_owner }}/${{ env.CI_REPOSITORY_NAME }}:php7-review
6565

66+
php8:
67+
runs-on: ubuntu-latest
68+
steps:
69+
- name: GitHub Environment Variables Action
70+
uses: FranzDiebold/github-env-vars-action@v2
71+
72+
- name: Shallow clone code
73+
uses: actions/checkout@v3
74+
with:
75+
fetch-depth: 0
76+
77+
- name: Login to Container Registry ghcr.io
78+
uses: docker/login-action@v2
79+
with:
80+
registry: ghcr.io
81+
username: ${{ github.actor }}
82+
password: ${{ secrets.GITHUB_TOKEN }}
83+
6684
#php8
6785
- name: Build the container image
6886
run: docker build . --tag ghcr.io/${{ github.repository_owner }}/${{ env.CI_REPOSITORY_NAME }}:php8 --file Dockerfile.php8
@@ -88,6 +106,20 @@ jobs:
88106
- name: Push with commit php8-review tag
89107
run: docker push ghcr.io/${{ github.repository_owner }}/${{ env.CI_REPOSITORY_NAME }}:php8-review
90108

109+
cleanup:
110+
needs: [php7, php8]
111+
runs-on: ubuntu-latest
112+
steps:
113+
- name: GitHub Environment Variables Action
114+
uses: FranzDiebold/github-env-vars-action@v2
115+
116+
- name: Login to Container Registry ghcr.io
117+
uses: docker/login-action@v2
118+
with:
119+
registry: ghcr.io
120+
username: ${{ github.actor }}
121+
password: ${{ secrets.GITHUB_TOKEN }}
122+
91123
- name: Delete old versions of the package, keeping a few of the newest
92124
uses: actions/delete-package-versions@v4
93125
with:

0 commit comments

Comments
 (0)