Skip to content

Commit ae9d5f1

Browse files
authored
Merge pull request #185 from bryanlatten/eol-versions-arm-8.1
Major: removed EOL PHP versions, added multi-arch, added github actions support
2 parents 86aa289 + f7260af commit ae9d5f1

35 files changed

+458
-1034
lines changed

.github/workflows/ci.yml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: ci
2+
3+
on:
4+
pull_request:
5+
branches: [ master ]
6+
7+
jobs:
8+
test:
9+
runs-on: ubuntu-latest
10+
strategy:
11+
matrix:
12+
variant:
13+
- 7.4
14+
- 7.4-alpine
15+
- 8.0
16+
platform:
17+
- linux/amd64
18+
# - linux/arm64
19+
exclude:
20+
- props:
21+
Dockerfile: Dockerfile-7.4-alpine
22+
- platform: linux/arm64
23+
env:
24+
TEST_MATCH: PHP Version ${{ matrix.props.version }}
25+
steps:
26+
-
27+
name: Checkout
28+
uses: actions/checkout@v2
29+
-
30+
name: Detect host configuration
31+
run: |
32+
# NOTE: Docker host configuration determines the networking target for integration testing
33+
v=$(mount | grep "/run/docker.sock")
34+
TARGET_HOST=
35+
36+
if [ -n "$v" ]; then
37+
echo "Injected docker socket detected"
38+
TARGET_HOST="host.docker.internal"
39+
elif [ -S /var/run/docker.sock ]; then
40+
TARGET_HOST="localhost"
41+
else
42+
echo "No Docker socket detected, fail"
43+
exit 1
44+
fi
45+
echo "TARGET_HOST=${TARGET_HOST}" >> $GITHUB_ENV
46+
-
47+
# Build and execute in multiple configurations: vanilla, with env overrides, with TLS enabled
48+
name: Build and test
49+
run: |
50+
# NOTE: docker qemu and buildx setup actions create a black hole for build cache layers, avoid unless pushing externally
51+
# Setup multi-arch platforms, noop if already installed for builder
52+
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64
53+
54+
TARGET_PLATFORM=${{ matrix.platform }}
55+
PHP_VARIANT=${{ matrix.variant }}
56+
PLATFORM=${TARGET_PLATFORM} PHP_VARIANT=${PHP_VARIANT} ./test.sh $TARGET_HOST

.github/workflows/publish.yml

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
name: publish
2+
3+
on:
4+
push:
5+
tags:
6+
- '*'
7+
8+
jobs:
9+
publish:
10+
runs-on: ubuntu-latest
11+
env:
12+
IMAGE_BASE: behance/docker-php
13+
strategy:
14+
matrix:
15+
# Variant distributions all have semantic versions + PHP version + suffix (ex. 3.2.1-alpine)
16+
props:
17+
- Dockerfile: Dockerfile-7.4-alpine
18+
version: "7.4"
19+
suffix: alpine
20+
platforms: linux/amd64
21+
- Dockerfile: Dockerfile-7.4
22+
version: "7.4"
23+
platforms: linux/amd64,linux/arm64
24+
- Dockerfile: Dockerfile-8.0
25+
version: "8.0"
26+
platforms: linux/amd64,linux/arm64
27+
steps:
28+
-
29+
name: Checkout
30+
uses: actions/checkout@v2
31+
-
32+
name: Add tag suffix if one exists
33+
if: matrix.props.suffix
34+
run: |
35+
echo TAG_SUFFIX="-${{ matrix.props.suffix }}" >> $GITHUB_ENV
36+
-
37+
name: Docker meta
38+
id: meta
39+
if: github.event_name != 'pull_request'
40+
uses: docker/metadata-action@v3
41+
with:
42+
images: ${{ env.IMAGE_BASE }}
43+
tags: |
44+
type=raw,priority=100,value=${{ matrix.props.version }}
45+
type=semver,priority=200,prefix=${{ matrix.props.version }}-,pattern={{major}}
46+
type=semver,priority=300,prefix=${{ matrix.props.version }}-,pattern={{major}}.{{minor}}
47+
type=semver,priority=400,prefix=${{ matrix.props.version }}-,pattern={{major}}.{{minor}}.{{patch}}
48+
flavor: |
49+
latest=auto
50+
suffix=${{ env.TAG_SUFFIX }}
51+
-
52+
name: Set up QEMU
53+
uses: docker/setup-qemu-action@v1
54+
-
55+
name: Set up Docker Buildx
56+
uses: docker/setup-buildx-action@v1
57+
-
58+
name: Login to DockerHub
59+
if: github.event_name != 'pull_request'
60+
uses: docker/login-action@v1
61+
with:
62+
username: ${{ secrets.DOCKERHUB_USERNAME }}
63+
password: ${{ secrets.DOCKERHUB_TOKEN }}
64+
-
65+
name: Build + push
66+
uses: docker/build-push-action@v2
67+
with:
68+
context: .
69+
platforms: ${{ matrix.props.platforms }}
70+
file: ${{ matrix.props.Dockerfile }}
71+
tags: ${{ steps.meta.outputs.tags }}
72+
push: ${{ github.event_name != 'pull_request' }}

.travis.yml

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,12 @@
11
sudo: required
22

33
env:
4-
- PHP_VARIANT=7.0
5-
- PHP_VARIANT=7.1
6-
- PHP_VARIANT=7.2
7-
- PHP_VARIANT=7.3
8-
- PHP_VARIANT=7.3-alpine
9-
- PHP_VARIANT=7.4
10-
- PHP_VARIANT=8.0
4+
global:
5+
- GOSS_INSTALL_PATH="./"
6+
jobs:
7+
- PHP_VARIANT=7.4-alpine
8+
- PHP_VARIANT=7.4
9+
- PHP_VARIANT=8.0
1110

1211
services:
1312
- docker

Dockerfile-7.0

Lines changed: 0 additions & 160 deletions
This file was deleted.

0 commit comments

Comments
 (0)