Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ci: Fix the docker image workflow #806

Merged
merged 6 commits into from
Jan 12, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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