-
Notifications
You must be signed in to change notification settings - Fork 23
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Multi-platform builds using GitHub workflows
- Loading branch information
1 parent
db76f85
commit 72b02fb
Showing
13 changed files
with
176 additions
and
123 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
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,43 @@ | ||
|
||
name: Docker Image Push | ||
|
||
on: | ||
workflow_dispatch: | ||
inputs: | ||
version: | ||
description: 'Image version to push (only specify one)' | ||
required: true | ||
default: '14.0' | ||
platform: | ||
description: 'Comma-separated list of platforms' | ||
required: true | ||
default: 'linux/arm/v7,linux/arm64,linux/386/linux/amd64' | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
strategy: | ||
matrix: | ||
php: ['7.3'] | ||
variant: ['apache', 'fpm', 'fpm-alpine'] | ||
|
||
steps: | ||
- name: Checkout Repo | ||
uses: actions/checkout@v2 | ||
|
||
- name: Setup QEMU | ||
uses: docker/setup-qemu-action@v1 | ||
|
||
- name: Setup Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
|
||
- name: Execute push hook | ||
id: docker_push_hook | ||
env: | ||
DOCKER_LOGIN: ${{ secrets.DOCKER_LOGIN }} | ||
DOCKER_PASSWORD: ${{ secrets.DOCKER_PASSWORD }} | ||
DOCKER_REGISTRY: ${{ secrets.DOCKER_REGISTRY }} | ||
DOCKER_PLATFORM: ${{ github.event.inputs.platform }} | ||
run: | | ||
cd images/${{ github.event.inputs.version }}/php${{ matrix.php }}-${{ matrix.variant }} | ||
./hooks/run_push |
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 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 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 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 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 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 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 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 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 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,34 @@ | ||
#!/bin/bash | ||
|
||
# Custom script to run locally DockerHub hooks | ||
# See documentation for details: | ||
# https://docs.docker.com/docker-hub/builds/advanced/ | ||
|
||
echo "Custom script to run locally DockerHub hooks..." | ||
set -e | ||
|
||
export SOURCE_BRANCH | ||
SOURCE_BRANCH=$(git rev-parse --abbrev-ref HEAD) | ||
export SOURCE_COMMIT | ||
SOURCE_COMMIT=$(git rev-parse --short HEAD) | ||
export COMMIT_MSG | ||
COMMIT_MSG=$(git log -1 --format=%s) | ||
|
||
export DOCKER_REPO=monogramm/docker-dolibarr | ||
export DOCKERFILE_PATH=Dockerfile | ||
export DOCKER_TAG=${VARIANT} | ||
export IMAGE_NAME=${DOCKER_REPO}:${DOCKER_TAG} | ||
|
||
# Execute hooks in given order | ||
IFS=',' read -ra STEPS <<< "${1:-push}" | ||
for step in "${STEPS[@]}" | ||
do | ||
for hook in "pre_${step}" "${step}" "post_${step}"; do | ||
if [ -f "./hooks/${hook}" ]; then | ||
echo "Executing ${hook} hook..." | ||
"./hooks/${hook}" | ||
fi | ||
done | ||
done | ||
|
||
echo "DockerHub hooks finished" |
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