-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
0 parents
commit 51ea317
Showing
3 changed files
with
89 additions
and
0 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,54 @@ | ||
name: build_and_publish | ||
on: | ||
push: | ||
branches-ignore: | ||
# prevent building on commits to any branch | ||
- '**' | ||
tags: | ||
# Build on every tag: | ||
- '**' | ||
pull_request: | ||
|
||
jobs: | ||
login-build-and-push: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v2 | ||
- | ||
name: Set up Docker Buildx | ||
uses: docker/setup-buildx-action@v1 | ||
- | ||
name: Login to the GitHub Container Registry | ||
uses: docker/login-action@v1 | ||
with: | ||
registry: ghcr.io | ||
username: ${{ github.repository_owner }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
- | ||
if: contains(github.ref, 'refs/tags/') | ||
name: Build and push release image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/ci-php:latest | ||
ghcr.io/${{ github.repository_owner }}/ci-php:${{ github.ref_name }} | ||
- | ||
if: contains(github.ref, 'refs/pull/') | ||
name: Build and push pull request image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/ci-php:review-pr-${{ github.event.pull_request.number }}-${{ github.head_ref }} | ||
- | ||
# not used / triggered at the moment: | ||
if: contains(github.ref, 'refs/heads/') | ||
name: Build and push the feature branch image | ||
uses: docker/build-push-action@v2 | ||
with: | ||
push: true | ||
tags: | | ||
ghcr.io/${{ github.repository_owner }}/ci-php:${{ github.ref_name }} |
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,24 @@ | ||
FROM php:8.0.23-fpm-alpine3.16 | ||
|
||
LABEL maintainer="[email protected]" | ||
LABEL org.opencontainers.image.source="https://github.com/morpht/ci-php" | ||
|
||
ENV COMPOSER_VERSION=2.3.10 \ | ||
COMPOSER_HASH_SHA256=d808272f284fa8e0f8b470703e1438ac8f362030bbc9d12e29530277d767aff0 | ||
|
||
RUN apk add --no-cache --update git \ | ||
bash \ | ||
openssh-client \ | ||
mysql-client \ | ||
patch \ | ||
rsync \ | ||
libpng libpng-dev \ | ||
&& docker-php-ext-install gd pdo pdo_mysql \ | ||
&& apk del libpng-dev \ | ||
&& rm -rf /var/cache/apk/* \ | ||
&& curl -L -o /usr/local/bin/composer https://github.com/composer/composer/releases/download/${COMPOSER_VERSION}/composer.phar \ | ||
&& echo "$COMPOSER_HASH_SHA256 /usr/local/bin/composer" | sha256sum -c \ | ||
&& chmod +x /usr/local/bin/composer | ||
|
||
# Remove warning about running as root in composer | ||
ENV COMPOSER_ALLOW_SUPERUSER=1 |
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,11 @@ | ||
# ci-php | ||
|
||
Docker image based on the official dockerhub image php:8.x-fpm-alpine3.y | ||
|
||
A few modifications: | ||
|
||
- added composer v2.3.x | ||
- installed several packages, e.g. git and mysql-client | ||
- added php extensions - gd, pdo_mysql | ||
|
||
Published in GHCR - https://github.com/morpht/ci-php/pkgs/container/ci-php |