Skip to content

Commit

Permalink
ci: Fix the docker image workflow (#806)
Browse files Browse the repository at this point in the history
  • Loading branch information
theofidry committed Jan 12, 2023
1 parent 0bf8185 commit 3a6f84d
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 9 deletions.
4 changes: 2 additions & 2 deletions .docker/build
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ set -euf -o pipefail

readonly SCRIPT_DIR=$(dirname $(realpath "${BASH_SOURCE:-$0}"))

if [[ "$(docker images -q box_php725 2> /dev/null)" == "" ]]; then
docker build --platform=linux/amd64 --tag=box_php725 --file "${SCRIPT_DIR}/php725" .
if [[ "$(docker images -q ghcr.io/box-project/box_php725 2> /dev/null)" == "" ]]; then
docker build --platform=linux/amd64 --tag=ghcr.io/box-project/box_php725 --file "${SCRIPT_DIR}/php725" .
fi

if [[ "$(docker images -q box_php81 2> /dev/null)" == "" ]]; then
Expand Down
13 changes: 7 additions & 6 deletions .github/workflows/docker.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -21,13 +21,13 @@ jobs:
include:
- name: PHP 7.2.5
docker-file: .docker/php725
image-tag: box/php725
image-tag: ghcr.io/box-project/box_php725
- name: PHP 8.1
docker-file: .docker/php81
image-tag: box/php81
image-tag: ghcr.io/box-project/box_php81
- name: PHP 8.1 (Xdebug)
docker-file: .docker/php81_xdebug
image-tag: box/php81_xdebug
image-tag: ghcr.io/box-project/box_php81_xdebug
steps:
- name: Checkout
uses: actions/checkout@v3
Expand All @@ -53,19 +53,20 @@ jobs:
context: .
file: ${{ matrix.docker-file }}
platforms: linux/amd64
tags: ghcr.io/${{ matrix.image-tag }}
tags: ${{ matrix.image-tag }}
load: true

- name: Test the image
run: docker run --rm ghcr.io/${{ matrix.image-tag }} php --version
run: docker run --rm ${{ matrix.image-tag }} php --version

- name: Build and push
if: github.event_name != 'pull_request'
uses: docker/build-push-action@v3
with:
context: .
file: ${{ matrix.docker-file }}
platforms: linux/amd64
tags: ghcr.io/${{ matrix.image-tag }}
tags: ${{ matrix.image-tag }}
push: true
cache-from: type=gha, scope=${{ github.workflow }}
cache-to: type=gha, scope=${{ github.workflow }}
Expand Down
2 changes: 1 addition & 1 deletion requirement-checker/Makefile.e2e
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@ DIFF = diff --strip-trailing-cr --ignore-all-space --side-by-side --suppress-com
DOCKER_RUN = docker run --interactive --platform linux/amd64 --rm --workdir=/opt/box

# Matches the minimum PHP version supported by Composer.
DOCKER_MIN_COMPOSER_PHP_VERSION_IMAGE_TAG = box_php725
DOCKER_MIN_COMPOSER_PHP_VERSION_IMAGE_TAG = ghcr.io/box-project/box_php725
DOCKER_MIN_COMPOSER_PHP_VERSION_RUN_COMMAND = $(DOCKER_MIN_COMPOSER_PHP_VERSION_IMAGE_TAG) php index.phar -vvv --no-ansi

# Matches the minimum PHP version supported by Box.
Expand Down

0 comments on commit 3a6f84d

Please sign in to comment.