Skip to content

Commit

Permalink
[devkit] php devkit
Browse files Browse the repository at this point in the history
  • Loading branch information
shish committed Apr 8, 2024
1 parent 0438be3 commit a8970bb
Show file tree
Hide file tree
Showing 2 changed files with 53 additions and 0 deletions.
15 changes: 15 additions & 0 deletions .docker/php.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM debian:unstable AS build
ARG VERSION
RUN apt update && apt install -y build-essential wget git libxml2-dev libsqlite3-dev libssl-dev autoconf
RUN adduser --disabled-password dev
USER dev
RUN wget -nv https://www.php.net/distributions/php-${VERSION}.tar.gz -O - \
| tar -xz -C /tmp
RUN cd /tmp/php-${VERSION} && ./configure --prefix=/home/dev/.php --with-openssl && make -j install
ENV PATH="/home/dev/.php/bin:$PATH"
RUN curl https://getcomposer.org/installer | php -- --quiet --install-dir=/home/dev/.php/bin/ --filename=composer
RUN git clone https://github.com/Ponup/php-sdl ~/php-sdl \
&& cd ~/php-sdl && phpize && ./configure && make -j

FROM scratch
COPY --from=build /home/dev/.php /home/dev/.php
38 changes: 38 additions & 0 deletions .github/workflows/devkit-php.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Devkit (php)

on:
push:
branches:
- master
- main
paths:
- '.docker/php.dockerfile'
- '.github/workflows/devkit-php.yml'
pull_request:
paths:
- '.docker/php.dockerfile'
- '.github/workflows/devkit-php.yml'
workflow_dispatch:

jobs:
build:
name: Build
runs-on: ubuntu-22.04
matrix:
lang: ["php"]
version: ["8.3.4"]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Publish
uses: elgohr/Publish-Docker-Github-Action@main
with:
name: shish2k/rosettaboy-devkit-${{ matrix.lang }}
dockerfile: .docker/${{ matrix.lang }}.dockerfile
buildoptions: "--build-arg VERSION=${{ matrix.version }}"
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
tags: ${{ matrix.version }}
platforms: linux/amd64,linux/arm64

0 comments on commit a8970bb

Please sign in to comment.