Skip to content

Commit

Permalink
ci: do not use variable inside copy --from
Browse files Browse the repository at this point in the history
  • Loading branch information
Dannecron committed Oct 10, 2023
1 parent 3debe8e commit 6c94c20
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 12 deletions.
6 changes: 4 additions & 2 deletions .github/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,11 @@
ARG PHP_VERSION=8.2.11
ARG COMPOSER_VERSION=2.6.5

FROM php:${PHP_VERSION}-cli-alpine
FROM composer:${COMPOSER_VERSION} as composer

COPY --from=composer:${COMPOSER_VERSION} /usr/bin/composer /usr/bin/composer
FROM php:${PHP_VERSION}-cli-alpine as runtime

COPY --from=composer /usr/bin/composer /usr/bin/composer

WORKDIR /app

Expand Down
22 changes: 12 additions & 10 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,12 @@ jobs:
- name: Build docker image
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \
--build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \
--tag=dannecron/coverage-merger:latest \
--file=./.github/Dockerfile .
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \
--build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \
--target=runtime \
--tag=dannecron/coverage-merger:latest \
--file=./.github/Dockerfile .
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
Expand All @@ -91,11 +92,12 @@ jobs:
- name: Build docker image
run: |
DOCKER_BUILDKIT=1 docker build \
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \
--build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \
--tag=dannecron/coverage-merger:latest \
--file=./.github/Dockerfile .
--build-arg BUILDKIT_INLINE_CACHE=1 \
--build-arg PHP_VERSION=${{ vars.DOCKER_RUNTIME_PHP_VERSION }} \
--build-arg COMPOSER_VERSION=${{ vars.DOCKER_RUNTIME_COMPOSER_VERSION }} \
--target=runtime
--tag=dannecron/coverage-merger:latest \
--file=./.github/Dockerfile .
- name: Login to docker hub
uses: actions-hub/docker/login@master
env:
Expand Down

0 comments on commit 6c94c20

Please sign in to comment.