-
Notifications
You must be signed in to change notification settings - Fork 35
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #185 from bryanlatten/eol-versions-arm-8.1
Major: removed EOL PHP versions, added multi-arch, added github actions support
- Loading branch information
Showing
35 changed files
with
458 additions
and
1,034 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
name: ci | ||
|
||
on: | ||
pull_request: | ||
branches: [ master ] | ||
|
||
jobs: | ||
test: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
variant: | ||
- 7.4 | ||
- 7.4-alpine | ||
- 8.0 | ||
platform: | ||
- linux/amd64 | ||
# - linux/arm64 | ||
exclude: | ||
- props: | ||
Dockerfile: Dockerfile-7.4-alpine | ||
- platform: linux/arm64 | ||
env: | ||
TEST_MATCH: PHP Version ${{ matrix.props.version }} | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Detect host configuration | ||
run: | | ||
# NOTE: Docker host configuration determines the networking target for integration testing | ||
v=$(mount | grep "/run/docker.sock") | ||
TARGET_HOST= | ||
if [ -n "$v" ]; then | ||
echo "Injected docker socket detected" | ||
TARGET_HOST="host.docker.internal" | ||
elif [ -S /var/run/docker.sock ]; then | ||
TARGET_HOST="localhost" | ||
else | ||
echo "No Docker socket detected, fail" | ||
exit 1 | ||
fi | ||
echo "TARGET_HOST=${TARGET_HOST}" >> $GITHUB_ENV | ||
- | ||
# Build and execute in multiple configurations: vanilla, with env overrides, with TLS enabled | ||
name: Build and test | ||
run: | | ||
# NOTE: docker qemu and buildx setup actions create a black hole for build cache layers, avoid unless pushing externally | ||
# Setup multi-arch platforms, noop if already installed for builder | ||
docker run --privileged --rm tonistiigi/binfmt --install arm64,amd64 | ||
TARGET_PLATFORM=${{ matrix.platform }} | ||
PHP_VARIANT=${{ matrix.variant }} | ||
PLATFORM=${TARGET_PLATFORM} PHP_VARIANT=${PHP_VARIANT} ./test.sh $TARGET_HOST |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
name: publish | ||
|
||
on: | ||
push: | ||
tags: | ||
- '*' | ||
|
||
jobs: | ||
publish: | ||
runs-on: ubuntu-latest | ||
env: | ||
IMAGE_BASE: behance/docker-php | ||
strategy: | ||
matrix: | ||
# Variant distributions all have semantic versions + PHP version + suffix (ex. 3.2.1-alpine) | ||
props: | ||
- Dockerfile: Dockerfile-7.4-alpine | ||
version: "7.4" | ||
suffix: alpine | ||
platforms: linux/amd64 | ||
- Dockerfile: Dockerfile-7.4 | ||
version: "7.4" | ||
platforms: linux/amd64,linux/arm64 | ||
- Dockerfile: Dockerfile-8.0 | ||
version: "8.0" | ||
platforms: linux/amd64,linux/arm64 | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Add tag suffix if one exists | ||
if: matrix.props.suffix | ||
run: | | ||
echo TAG_SUFFIX="-${{ matrix.props.suffix }}" >> $GITHUB_ENV | ||
- | ||
name: Docker meta | ||
id: meta | ||
if: github.event_name != 'pull_request' | ||
uses: docker/metadata-action@v3 | ||
with: | ||
images: ${{ env.IMAGE_BASE }} | ||
tags: | | ||
type=raw,priority=100,value=${{ matrix.props.version }} | ||
type=semver,priority=200,prefix=${{ matrix.props.version }}-,pattern={{major}} | ||
type=semver,priority=300,prefix=${{ matrix.props.version }}-,pattern={{major}}.{{minor}} | ||
type=semver,priority=400,prefix=${{ matrix.props.version }}-,pattern={{major}}.{{minor}}.{{patch}} | ||
flavor: | | ||
latest=auto | ||
suffix=${{ env.TAG_SUFFIX }} | ||
- | ||
name: Set up QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to DockerHub | ||
if: github.event_name != 'pull_request' | ||
uses: docker/login-action@v1 | ||
with: | ||
username: ${{ secrets.DOCKERHUB_USERNAME }} | ||
password: ${{ secrets.DOCKERHUB_TOKEN }} | ||
- | ||
name: Build + push | ||
uses: docker/build-push-action@v2 | ||
with: | ||
context: . | ||
platforms: ${{ matrix.props.platforms }} | ||
file: ${{ matrix.props.Dockerfile }} | ||
tags: ${{ steps.meta.outputs.tags }} | ||
push: ${{ github.event_name != 'pull_request' }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.