Skip to content

Commit

Permalink
first approach to test the pipeline
Browse files Browse the repository at this point in the history
  • Loading branch information
Juan Manuel "Kang" Perez committed Mar 21, 2024
1 parent 27de03c commit a193569
Show file tree
Hide file tree
Showing 4 changed files with 113 additions and 12 deletions.
82 changes: 78 additions & 4 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -27,12 +27,37 @@ jobs:
- uses: actions/checkout@v4
- uses: docker/setup-qemu-action@v3
- uses: docker/setup-buildx-action@v3

- uses: docker/build-push-action@v5
id: base-image
with:
push: false
load: true
platforms: ${{ env.BUILD_ARCHITECTURES }}
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ci.invalid/${{ env.IMAGE_NAME }}:build-test
- uses: docker/build-push-action@v5
with:
push: false
platforms: ${{ env.BUILD_ARCHITECTURES }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile.nginx
build-args: |
BASE_IMAGE=ci.invalid/${{ env.IMAGE_NAME }}:build-test
- uses: docker/build-push-action@v5
with:
push: false
platforms: ${{ env.BUILD_ARCHITECTURES }}
cache-from: type=gha
cache-to: type=gha,mode=max
file: Dockerfile.caddy
build-args: |
BASE_IMAGE=ci.invalid/${{ env.IMAGE_NAME }}:build-test
push-image:
name: Push images
Expand All @@ -48,11 +73,57 @@ jobs:
registry: ${{ env.REGISTRY }}
username: ${{ github.repository_owner }}
password: ${{ secrets.GITHUB_TOKEN }}

- uses: docker/metadata-action@v5
id: meta-php-fpm
with:
context: git
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
tags: |
type=edge,branch=${{ github.event.repository.default_branch }}
- uses: docker/build-push-action@v5
with:
push: true
platforms: ${{ env.BUILD_ARCHITECTURES }}
cache-from: type=gha
cache-to: type=gha,mode=max
annotations: ${{ steps.meta-php-fpm.outputs.annotations }}
labels: ${{ steps.meta-php-fpm.outputs.labels }}
tags: ${{ steps.meta-php-fpm.outputs.tags }}

- uses: docker/metadata-action@v5
id: meta-nginx
with:
context: git
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
suffix=nginx
tags: |
type=edge,branch=${{ github.event.repository.default_branch }}
- uses: docker/build-push-action@v5
with:
push: true
platforms: ${{ env.BUILD_ARCHITECTURES }}
cache-from: type=gha
cache-to: type=gha,mode=max
annotations: ${{ steps.meta-nginx.outputs.annotations }}
labels: ${{ steps.meta-nginx.outputs.labels }}
tags: ${{ steps.meta-nginx.outputs.tags }}
file: Dockerfile.nginx
build-args: |
BASE_IMAGE=davis-build:${{ fromJSON(steps.meta-php-fpm.outputs.json).tags[0] }}
- uses: docker/metadata-action@v5
id: meta
id: meta-caddy
with:
context: git
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
flavor: |
latest=auto
suffix=caddy
tags: |
type=edge,branch=${{ github.event.repository.default_branch }}
- uses: docker/build-push-action@v5
Expand All @@ -61,6 +132,9 @@ jobs:
platforms: ${{ env.BUILD_ARCHITECTURES }}
cache-from: type=gha
cache-to: type=gha,mode=max
annotations: ${{ steps.meta.outputs.annotations }}
labels: ${{ steps.meta.outputs.labels }}
tags: ${{ steps.meta.outputs.tags }}
annotations: ${{ steps.meta-caddy.outputs.annotations }}
labels: ${{ steps.meta-caddy.outputs.labels }}
tags: ${{ steps.meta-caddy.outputs.tags }}
file: Dockerfile.caddy
build-args: |
BASE_IMAGE=davis-build:${{ fromJSON(steps.meta-php-fpm.outputs.json).tags[0] }}
29 changes: 21 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -47,26 +47,39 @@ RUN apk --update --no-cache add \
openssl-dev \
krb5-dev

# Leaving a Docker layer per extension so in case it fails I have it cached to develop faster.
# Leaving a Docker layer per extension so in case it fails I have it cached to develop faster.
# But we are also cleaning each layer so it does not grow to the point we get out of cache space.

# Intl support
RUN docker-php-ext-install intl
RUN docker-php-ext-install -j$(nproc) intl && \
docker-php-source delete && \
rm -rf /tmp/*
# PDO: MySQL
RUN docker-php-ext-configure pdo_mysql --with-pdo-mysql=mysqlnd && \
docker-php-ext-install pdo_mysql
docker-php-ext-install -j$(nproc) pdo_mysql && \
docker-php-source delete && \
rm -rf /tmp/*
# PDO: PostgreSQL
RUN docker-php-ext-configure pgsql --with-pgsql=/usr/local/pgsql && \
docker-php-ext-install pgsql pdo_pgsql
docker-php-ext-install -j$(nproc) pgsql pdo_pgsql && \
docker-php-source delete && \
rm -rf /tmp/*
# GD (map image in mail)
RUN docker-php-ext-configure gd --with-freetype && \
docker-php-ext-install gd && \
docker-php-ext-enable gd
docker-php-ext-install -j$(nproc) gd && \
docker-php-ext-enable gd && \
docker-php-source delete && \
rm -rf /tmp/*
# LDAP auth support
RUN docker-php-ext-configure ldap && \
docker-php-ext-install ldap
docker-php-ext-install -j$(nproc) ldap && \
docker-php-source delete && \
rm -rf /tmp/*
# IMAP auth support
RUN docker-php-ext-configure imap --with-kerberos --with-imap-ssl && \
docker-php-ext-install imap
docker-php-ext-install -j$(nproc) imap && \
docker-php-source delete && \
rm -rf /tmp/*


###################################################
Expand Down
7 changes: 7 additions & 0 deletions Dockerfile.caddy
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG BASE_IMAGE

FROM ${BASE_IMAGE}

RUN apk --no-progress --update add --no-cache \
supervisor \
caddy
7 changes: 7 additions & 0 deletions Dockerfile.nginx
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
ARG BASE_IMAGE

FROM ${BASE_IMAGE}

RUN apk --no-progress --update add --no-cache \
supervisor \
nginx

0 comments on commit a193569

Please sign in to comment.