Skip to content

Commit a51b814

Browse files
committed
php 8.4
1 parent 4b6d62f commit a51b814

5 files changed

+613
-0
lines changed
Lines changed: 128 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,128 @@
1+
name: 'build docker images: Alpine + 8.4 PHP-FPM'
2+
3+
on:
4+
#push:
5+
# branches:
6+
# - 'main'
7+
# - 'master'
8+
# paths:
9+
# - 'alpine.fpm.slim.Dockerfile'
10+
# - 'alpine.fpm.Dockerfile'
11+
# - '.github/workflows/build_docker_images-php8_4-alpine_fpm.yaml'
12+
workflow_dispatch:
13+
schedule:
14+
- cron: '45 2 24 * *' # At 02:45 on day-of-month 24.
15+
16+
defaults:
17+
run:
18+
shell: bash
19+
20+
jobs:
21+
docker:
22+
runs-on: ubuntu-latest
23+
steps:
24+
- name: Checkout
25+
uses: actions/checkout@v2
26+
27+
- name: Shell-Script
28+
id: script
29+
run: |
30+
BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
31+
BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}"
32+
COMMIT_HASH=${GITHUB_SHA::8}
33+
GITHUB_REPO=${GITHUB_REPOSITORY,,}
34+
GITHUB_REPO_SHORT=${GITHUB_REPO#*/}
35+
GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"}
36+
DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT}
37+
REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT}
38+
39+
PHP_VERSION="8.4"
40+
41+
# Set output parameters to github action.
42+
echo ::set-output name=build_date::${BUILD_DATE}
43+
echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC}
44+
echo ::set-output name=commit_hash::${COMMIT_HASH}
45+
echo ::set-output name=github_repo::${GITHUB_REPO}
46+
echo ::set-output name=docker_repo::${DOCKER_REPO}
47+
echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO}
48+
49+
echo ::set-output name=php_version::${PHP_VERSION}
50+
51+
- name: Set up QEMU
52+
id: qemu
53+
uses: docker/setup-qemu-action@v1
54+
with:
55+
image: tonistiigi/binfmt:latest
56+
platforms: all
57+
58+
- name: Set up Docker Buildx
59+
id: buildx
60+
uses: docker/setup-buildx-action@master
61+
62+
#- name: Login to GitHub Container Registry
63+
# uses: docker/login-action@v1
64+
# with:
65+
# registry: ghcr.io
66+
# username: ${{ github.repository_owner }}
67+
# password: ${{ secrets.GITHUB_TOKEN }}
68+
69+
- name: Login to DockerHub
70+
uses: docker/login-action@v1
71+
with:
72+
registry: docker.io
73+
username: ${{ secrets.DOCKER_USERNAME }}
74+
password: ${{ secrets.DOCKER_PASSWORD }}
75+
76+
#- name: Login to RED HAT Quay.io Container Registry
77+
# uses: docker/login-action@v1
78+
# with:
79+
# registry: quay.io
80+
# username: ${{ secrets.REDHAT_QUAY_USERNAME }}
81+
# password: ${{ secrets.REDHAT_QUAY_PASSWORD }}
82+
83+
- name: Build-slim
84+
uses: docker/build-push-action@v2
85+
with:
86+
builder: ${{ steps.buildx.outputs.name }}
87+
context: .
88+
file: ./alpine.fpm.slim.Dockerfile
89+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6
90+
#pull: true
91+
push: true
92+
build-args: |
93+
BUILD_DATE=${{steps.script.outputs.build_date}}
94+
VCS_REF=${{steps.script.outputs.commit_hash}}
95+
PHP_VERSION=${{steps.script.outputs.php_version}}
96+
tags: |
97+
docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim
98+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}}
99+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim
100+
# quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-slim
101+
102+
- name: Build
103+
uses: docker/build-push-action@v2
104+
with:
105+
builder: ${{ steps.buildx.outputs.name }}
106+
context: .
107+
file: ./alpine.fpm.Dockerfile
108+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
109+
pull: true
110+
push: true
111+
build-args: |
112+
BUILD_DATE=${{steps.script.outputs.build_date}}
113+
VCS_REF=${{steps.script.outputs.commit_hash}}
114+
PHP_VERSION=${{steps.script.outputs.php_version}}
115+
tags: |
116+
docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine
117+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}}
118+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine
119+
# quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-alpine
120+
121+
- name: Docker Hub Description
122+
uses: peter-evans/dockerhub-description@v3
123+
with:
124+
username: ${{ secrets.DOCKER_USERNAME }}
125+
password: ${{ secrets.DOCKER_PASSWORD }}
126+
repository: ${{steps.script.outputs.docker_repo}}
127+
short-description: ${{ github.event.repository.description }}
128+
readme-filepath: README.md
Lines changed: 148 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,148 @@
1+
name: 'build docker images: Alpine + 8.4 PHP-FPM + NGINX'
2+
3+
on:
4+
#push:
5+
# branches:
6+
# - 'main'
7+
# - 'master'
8+
# paths:
9+
# - 'alpine.fpm_nginx.slim.Dockerfile'
10+
# - 'alpine.fpm_nginx.Dockerfile'
11+
# - 'alpine.fpm_nginx.extended.Dockerfile'
12+
# - '.github/workflows/build_docker_images-php8_4-alpine_fpm_nginx.yaml'
13+
workflow_dispatch:
14+
schedule:
15+
- cron: '45 5 24 * *' # At 05:45 on day-of-month 24.
16+
17+
defaults:
18+
run:
19+
shell: bash
20+
21+
jobs:
22+
docker:
23+
runs-on: ubuntu-latest
24+
steps:
25+
- name: Checkout
26+
uses: actions/checkout@v2
27+
28+
- name: Shell-Script
29+
id: script
30+
run: |
31+
BUILD_DATE="$(date -u +'%Y-%m-%dT%H:%M:%SZ')"
32+
BUILD_DATE_NUMERIC="${BUILD_DATE//[^[:digit:]]/}"
33+
COMMIT_HASH=${GITHUB_SHA::8}
34+
GITHUB_REPO=${GITHUB_REPOSITORY,,}
35+
GITHUB_REPO_SHORT=${GITHUB_REPO#*/}
36+
GITHUB_REPO_SHORT=${GITHUB_REPO_SHORT#"docker-"}
37+
DOCKER_REPO=${{ secrets.DOCKER_USERNAME }}/${GITHUB_REPO_SHORT}
38+
REDHAT_QUAY_REPO=${{ secrets.REDHAT_QUAY_USERNAME }}/${GITHUB_REPO_SHORT}
39+
40+
PHP_VERSION="8.4"
41+
42+
# Set output parameters to github action.
43+
echo ::set-output name=build_date::${BUILD_DATE}
44+
echo ::set-output name=build_date_numeric::${BUILD_DATE_NUMERIC}
45+
echo ::set-output name=commit_hash::${COMMIT_HASH}
46+
echo ::set-output name=github_repo::${GITHUB_REPO}
47+
echo ::set-output name=docker_repo::${DOCKER_REPO}
48+
echo ::set-output name=redhat_quay_repo::${REDHAT_QUAY_REPO}
49+
50+
echo ::set-output name=php_version::${PHP_VERSION}
51+
52+
- name: Set up QEMU
53+
id: qemu
54+
uses: docker/setup-qemu-action@v1
55+
with:
56+
image: tonistiigi/binfmt:latest
57+
platforms: all
58+
59+
- name: Set up Docker Buildx
60+
id: buildx
61+
uses: docker/setup-buildx-action@master
62+
63+
#- name: Login to GitHub Container Registry
64+
# uses: docker/login-action@v1
65+
# with:
66+
# registry: ghcr.io
67+
# username: ${{ github.repository_owner }}
68+
# password: ${{ secrets.GITHUB_TOKEN }}
69+
70+
- name: Login to DockerHub
71+
uses: docker/login-action@v1
72+
with:
73+
registry: docker.io
74+
username: ${{ secrets.DOCKER_USERNAME }}
75+
password: ${{ secrets.DOCKER_PASSWORD }}
76+
77+
#- name: Login to RED HAT Quay.io Container Registry
78+
# uses: docker/login-action@v1
79+
# with:
80+
# registry: quay.io
81+
# username: ${{ secrets.REDHAT_QUAY_USERNAME }}
82+
# password: ${{ secrets.REDHAT_QUAY_PASSWORD }}
83+
84+
- name: Build-slim
85+
uses: docker/build-push-action@v2
86+
with:
87+
builder: ${{ steps.buildx.outputs.name }}
88+
context: .
89+
file: ./alpine.fpm_nginx.slim.Dockerfile
90+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7,linux/arm/v6
91+
pull: true
92+
push: true
93+
build-args: |
94+
BUILD_DATE=${{steps.script.outputs.build_date}}
95+
VCS_REF=${{steps.script.outputs.commit_hash}}
96+
PHP_VERSION=${{steps.script.outputs.php_version}}
97+
tags: |
98+
docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim
99+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}}
100+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim
101+
# quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-slim
102+
103+
- name: Build
104+
uses: docker/build-push-action@v2
105+
with:
106+
builder: ${{ steps.buildx.outputs.name }}
107+
context: .
108+
file: ./alpine.fpm_nginx.Dockerfile
109+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
110+
pull: true
111+
push: true
112+
build-args: |
113+
BUILD_DATE=${{steps.script.outputs.build_date}}
114+
VCS_REF=${{steps.script.outputs.commit_hash}}
115+
PHP_VERSION=${{steps.script.outputs.php_version}}
116+
tags: |
117+
docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine
118+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}}
119+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine
120+
# quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine
121+
122+
- name: Build-extended
123+
uses: docker/build-push-action@v2
124+
with:
125+
builder: ${{ steps.buildx.outputs.name }}
126+
context: .
127+
file: ./alpine.fpm_nginx.extended.Dockerfile
128+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
129+
pull: true
130+
push: true
131+
build-args: |
132+
BUILD_DATE=${{steps.script.outputs.build_date}}
133+
VCS_REF=${{steps.script.outputs.commit_hash}}
134+
PHP_VERSION=${{steps.script.outputs.php_version}}
135+
tags: |
136+
docker.io/${{steps.script.outputs.docker_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended
137+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended-${{steps.script.outputs.build_date_numeric}}.${{steps.script.outputs.commit_hash}}
138+
# ghcr.io/${{steps.script.outputs.github_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended
139+
# quay.io/${{steps.script.outputs.redhat_quay_repo}}:${{steps.script.outputs.php_version}}-fpm-nginx-alpine-extended
140+
141+
- name: Docker Hub Description
142+
uses: peter-evans/dockerhub-description@v3
143+
with:
144+
username: ${{ secrets.DOCKER_USERNAME }}
145+
password: ${{ secrets.DOCKER_PASSWORD }}
146+
repository: ${{steps.script.outputs.docker_repo}}
147+
short-description: ${{ github.event.repository.description }}
148+
readme-filepath: README.md

0 commit comments

Comments
 (0)