Skip to content

Commit

Permalink
Merge pull request #7 from digiBlink/update_20241114
Browse files Browse the repository at this point in the history
more updates
  • Loading branch information
zxpower authored Nov 14, 2024
2 parents cb55379 + 30ef891 commit a65e884
Show file tree
Hide file tree
Showing 6 changed files with 101 additions and 86 deletions.
65 changes: 65 additions & 0 deletions .github/workflows/build-image.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,65 @@
name: Image Build
on:
workflow_call:

jobs:
build-image:
name: Build and push Docker image
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4
with:
ref: ${{ github.event.pull_request.head.sha }}

- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/digiblink/alpine-nginx-php74-pdf
tags: |
type=sha
type=ref,event=tag
type=raw,value=latest,enable={{is_default_branch}}
flavor: |
latest=auto
prefix=,onlatest=false
suffix=
labels: |
org.opencontainers.image.vendor=digiBlink
org.opencontainers.image.source=https://github.com/${{ env.REPO_NAME }}
org.opencontainers.image.title=Alpine based image with latest PHP7.4 FPM, Nginx and wkhtmltopdf
org.opencontainers.image.description=Alpine based image with latest PHP7.4 FPM, Nginx and wkhtmltopdf
org.opencontainers.image.created=${{ steps.time.outputs.time }}
org.opencontainers.image.revision=${{ steps.short-sha.outputs.sha }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to Docker Hub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ vars.DH_USER }}
password: ${{ secrets.DH_PAT }}

- name: Login to GHCR
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build image and push to GitHub Container Registry
uses: docker/build-push-action@v6
with:
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}

- name: Image digest
run: echo ${{ steps.docker_build.outputs.digest }}
43 changes: 0 additions & 43 deletions .github/workflows/main_build.yaml

This file was deleted.

39 changes: 0 additions & 39 deletions .github/workflows/pr_build.yaml

This file was deleted.

13 changes: 13 additions & 0 deletions .github/workflows/trigger-main-tag.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Trigger on Merge to Main / Tag

on:
push:
branches:
- main
tags:
- '*'

jobs:
build-image:
uses: ./.github/workflows/build-image.yaml
secrets: inherit
13 changes: 13 additions & 0 deletions .github/workflows/trigger-pr.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
name: Trigger on PR

on:
pull_request:

concurrency:
group: ${{ github.ref }}
cancel-in-progress: true

jobs:
build-image:
uses: ./.github/workflows/build-image.yaml
secrets: inherit
14 changes: 10 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,10 +1,16 @@
# final stage
FROM php:7.4.33-fpm-alpine3.16@sha256:0aeb129a60daff2874c5c70fcd9d88cdf3015b4fb4cc7c3f1a32a21e84631036

LABEL org.opencontainers.image.source https://github.com/digiblink/alpine-nginx-php74-pdf
LABEL org.opencontainers.image.description Alpine Linux Docker image with Nginx, PHP-FPM and wkhtmltopdf
LABEL org.opencontainers.image.source="https://github.com/digiblink/alpine-nginx-php74-pdf"
LABEL org.opencontainers.image.description="Alpine Linux Docker image with Nginx, PHP-FPM and wkhtmltopdf"

RUN apk -u add nginx wkhtmltopdf
RUN apk -u add nginx \
&& apk add icu-libs=67.1-r2 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.14/main \
&& apk add qt5-qtbase=5.15.3_git20210406-r0 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.14/community \
&& apk add qt5-qtbase-x11=5.15.3_git20210406-r0 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.14/community \
&& apk add qt5-qtsvg=5.15.3_git20200406-r0 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.14/community \
&& apk add qt5-qtwebkit=5.212.0_alpha4-r14 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.14/community \
&& apk add wkhtmltopdf=0.12.6-r0 --repository=http://dl-cdn.alpinelinux.org/alpine/v3.14/community

RUN docker-php-ext-install pdo_mysql \
&& docker-php-ext-install opcache
Expand All @@ -20,7 +26,7 @@ RUN { \

# phalcon version setting
ARG PSR_VERSION=1.2.0
ARG PHALCON_VERSION=5.8.0
ARG PHALCON_VERSION=4.1.3
ARG PHALCON_EXT_PATH=php7/64bits

RUN set -xe && \
Expand Down

0 comments on commit a65e884

Please sign in to comment.