-
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
Hannes Giesenow
committed
Dec 14, 2023
1 parent
00e33e9
commit c70a77a
Showing
6 changed files
with
145 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,44 @@ | ||
name: Create and publish a Docker image | ||
|
||
on: | ||
schedule: | ||
- cron: '0 9 1 * *' | ||
push: | ||
branches: | ||
- 'main' | ||
|
||
env: | ||
REGISTRY: ghcr.io | ||
IMAGE_NAME: ${{ github.repository }}/php | ||
|
||
jobs: | ||
build-and-push-image: | ||
runs-on: ubuntu-latest | ||
permissions: | ||
contents: read | ||
packages: write | ||
|
||
steps: | ||
- name: Checkout repository | ||
uses: actions/checkout@v3 | ||
|
||
- name: Log in to the Container registry | ||
uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1 | ||
with: | ||
registry: ${{ env.REGISTRY }} | ||
username: ${{ github.actor }} | ||
password: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- name: Extract metadata (tags, labels) for Docker | ||
id: meta | ||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7 | ||
with: | ||
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }} | ||
|
||
- name: Build and push Docker image | ||
uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4 | ||
with: | ||
context: docker | ||
push: true | ||
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:latest | ||
labels: ${{ steps.meta.outputs.labels }} |
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,4 @@ | ||
/.idea | ||
vendor/ | ||
composer.lock | ||
docker-compose.override.yml |
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,40 @@ | ||
{ | ||
"name": "elbformat/ibexa-icon-fieldtype", | ||
"description": "Field type to select an icon from a predefined set.", | ||
"type": "symfony-bundle", | ||
"license": "MIT", | ||
"keywords": [ | ||
"ibexa", | ||
"icon", | ||
"field-type" | ||
], | ||
"authors": [ | ||
{ | ||
"name": "Hannes Giesenow", | ||
"email": "[email protected]", | ||
"role": "Lead Developer" | ||
} | ||
], | ||
"autoload": { | ||
"psr-4": { | ||
"Elbformat\\IbexaIconFieldtype\\": "src/" | ||
} | ||
}, | ||
"require": { | ||
"php": ">=8.1", | ||
"ezsystems/ezplatform-core": "^2.3" | ||
}, | ||
"require-dev": { | ||
"phpunit/phpunit": "^9.5" | ||
}, | ||
"config": { | ||
"sort-packages": true, | ||
"allow-plugins": { | ||
"symfony/runtime": true, | ||
"composer/package-versions-deprecated": true, | ||
"php-http/discovery": false, | ||
"symfony/flex": true, | ||
"ibexa/post-install": true | ||
} | ||
} | ||
} |
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,16 @@ | ||
For local development you can use docker-compose. | ||
```bash | ||
docker-compose run php sh | ||
composer install | ||
``` | ||
|
||
Enable xdebug inside the container | ||
```bash | ||
export XDEBUG_CONFIG="client_host=172.17.0.1 idekey=PHPSTORM" | ||
export XDEBUG_MODE="debug" | ||
``` | ||
|
||
Run tests | ||
```bash | ||
vendor/bin/phpunit | ||
``` |
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,6 @@ | ||
version: '2.1' | ||
services: | ||
php: | ||
image: ghcr.io/elbformat/ibexa-icon-fieldtype/php | ||
volumes: | ||
- ./:/var/www |
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,35 @@ | ||
FROM php:8.2-fpm-alpine | ||
|
||
COPY --from=composer:2.5 /usr/bin/composer /usr/local/bin/composer | ||
|
||
# ext-intl | ||
RUN apk add --no-cache icu icu-data-full && \ | ||
apk add --no-cache --virtual .build-deps icu-dev && \ | ||
docker-php-ext-install intl && \ | ||
apk del .build-deps && \ | ||
rm -rf /tmp/* | ||
|
||
#ext-xsl | ||
RUN apk add --no-cache libxslt && \ | ||
apk add --no-cache --virtual .build-deps libxslt-dev && \ | ||
docker-php-ext-install xsl && \ | ||
apk del .build-deps && \ | ||
rm -rf /tmp/* | ||
|
||
# xdebug | ||
RUN apk add --no-cache --virtual .build-deps autoconf g++ make linux-headers && \ | ||
pecl install xdebug-3.2.1 && \ | ||
docker-php-ext-enable xdebug && \ | ||
apk del .build-deps && \ | ||
rm -rf /tmp/* | ||
|
||
# ext-gd | ||
RUN apk add --no-cache libpng libjpeg-turbo freetype && \ | ||
apk add --no-cache --virtual .build-deps libpng-dev libjpeg-turbo-dev freetype-dev && \ | ||
docker-php-ext-configure gd && \ | ||
docker-php-ext-install gd && \ | ||
apk del .build-deps && \ | ||
rm -rf /tmp/* | ||
|
||
RUN rmdir /var/www/html | ||
WORKDIR /var/www |