Skip to content

Commit

Permalink
feat(Admin): Makes upgraded PHP for Admin control panel standard (#169)
Browse files Browse the repository at this point in the history
- Fixes #166
- Updates the GitHub Action workflows to build the Admin control panel PHP version with the same PHP version as for vhosts.
  • Loading branch information
timnolte authored Jun 11, 2024
1 parent c38ae6a commit 41d43fb
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 75 deletions.
70 changes: 12 additions & 58 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
env:
OLS_VERSION: '1.7.19'
PHP_STABLE_VERSION: '8.3.6'
OLS_ADMIN_PHP_STABLE_VERSION: '7.4.33'
NODE_STABLE_VERSION: '20'
REGISTRY: ghcr.io

Expand All @@ -28,13 +27,6 @@ jobs:
- '16'
- '18'
- '20'
OLS_ADMIN_PHP_VERSION:
- '7.4.33'
include:
- job-name: 'OLS Admin PHP 8.x RC'
PHP_VERSION: '8.1.28'
NODE_VERSION: '20'
OLS_ADMIN_PHP_VERSION: '8.2.18'

steps:
- name: Checkout
Expand Down Expand Up @@ -73,22 +65,12 @@ jobs:
echo "_0=$_0" >> $GITHUB_OUTPUT
echo "_1=$_1" >> $GITHUB_OUTPUT
# https://github.com/orgs/community/discussions/26625#discussioncomment-3252582
- name: Determine OLS Admin PHP Major/Minor Version
id: ols-admin-php-version
run: |
_0=$(echo ${{ matrix.OLS_ADMIN_PHP_VERSION }} | cut -d. -f1)
_1=$(echo ${{ matrix.OLS_ADMIN_PHP_VERSION }} | cut -d. -f2)
echo "_0=$_0" >> $GITHUB_OUTPUT
echo "_1=$_1" >> $GITHUB_OUTPUT
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
if: |
matrix.PHP_VERSION != env.PHP_STABLE_VERSION
&& matrix.NODE_VERSION != env.NODE_STABLE_VERSION
&& matrix.OLS_ADMIN_PHP_VERSION == env.OLS_ADMIN_PHP_STABLE_VERSION
with:
context: template
platforms: linux/arm64
Expand All @@ -98,9 +80,9 @@ jobs:
PHP_VERSION=${{ matrix.PHP_VERSION }}
PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.OLS_ADMIN_PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.ols-admin-php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.ols-admin-php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
NODE_VERSION=${{ matrix.NODE_VERSION }}
push: true
tags: |
Expand All @@ -118,7 +100,6 @@ jobs:
if: |
matrix.PHP_VERSION == env.PHP_STABLE_VERSION
&& matrix.NODE_VERSION != env.NODE_STABLE_VERSION
&& matrix.OLS_ADMIN_PHP_VERSION == env.OLS_ADMIN_PHP_STABLE_VERSION
with:
context: template
platforms: linux/arm64
Expand All @@ -128,9 +109,9 @@ jobs:
PHP_VERSION=${{ matrix.PHP_VERSION }}
PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.OLS_ADMIN_PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.ols-admin-php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.ols-admin-php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
NODE_VERSION=${{ matrix.NODE_VERSION }}
push: true
tags: |
Expand All @@ -148,7 +129,6 @@ jobs:
if: |
matrix.PHP_VERSION != env.PHP_STABLE_VERSION
&& matrix.NODE_VERSION == env.NODE_STABLE_VERSION
&& matrix.OLS_ADMIN_PHP_VERSION == env.OLS_ADMIN_PHP_STABLE_VERSION
with:
context: template
platforms: linux/arm64
Expand All @@ -158,9 +138,9 @@ jobs:
PHP_VERSION=${{ matrix.PHP_VERSION }}
PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.OLS_ADMIN_PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.ols-admin-php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.ols-admin-php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
NODE_VERSION=${{ matrix.NODE_VERSION }}
push: true
tags: |
Expand All @@ -182,7 +162,6 @@ jobs:
if: |
matrix.PHP_VERSION == env.PHP_STABLE_VERSION
&& matrix.NODE_VERSION == env.NODE_STABLE_VERSION
&& matrix.OLS_ADMIN_PHP_VERSION == env.OLS_ADMIN_PHP_STABLE_VERSION
with:
context: template
platforms: linux/arm64
Expand All @@ -192,9 +171,9 @@ jobs:
PHP_VERSION=${{ matrix.PHP_VERSION }}
PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.OLS_ADMIN_PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.ols-admin-php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.ols-admin-php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
NODE_VERSION=${{ matrix.NODE_VERSION }}
push: true
tags: |
Expand All @@ -211,31 +190,6 @@ jobs:
cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed
cache-to: type=inline

# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build and Push Docker Image Admin PHP 8.x RC
uses: docker/build-push-action@v5
if: |
matrix.OLS_ADMIN_PHP_VERSION != env.OLS_ADMIN_PHP_STABLE_VERSION
with:
context: template
platforms: linux/arm64
provenance: false
build-args: |
OLS_VERSION=${{ env.OLS_VERSION }}
PHP_VERSION=${{ matrix.PHP_VERSION }}
PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.OLS_ADMIN_PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.ols-admin-php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.ols-admin-php-version.outputs._1 }}
NODE_VERSION=${{ matrix.NODE_VERSION }}
push: true
tags: |
${{ env.REGISTRY }}/ndigitals/openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }}-adminlsphp${{ steps.ols-admin-php-version.outputs._0 }}${{ steps.ols-admin-php-version.outputs._1 }}
no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed
cache-to: type=inline

release:
name: Publish Release
runs-on: ubuntu-latest
Expand Down
22 changes: 5 additions & 17 deletions .github/workflows/test-builds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,6 @@ on:
env:
OLS_VERSION: '1.7.19'
PHP_STABLE_VERSION: '8.3.6'
OLS_ADMIN_PHP_STABLE_VERSION: '7.4.33'
NODE_STABLE_VERSION: '20'
REGISTRY: ghcr.io

Expand All @@ -26,8 +25,6 @@ jobs:
NODE_VERSION:
- '18'
- '20'
OLS_ADMIN_PHP_VERSION:
- '7.4.33'
include:
- job-name: 'OLS Admin PHP 8.x RC'
PHP_VERSION: '8.1.28'
Expand Down Expand Up @@ -62,15 +59,6 @@ jobs:
echo "_0=$_0" >> $GITHUB_OUTPUT
echo "_1=$_1" >> $GITHUB_OUTPUT
# https://github.com/orgs/community/discussions/26625#discussioncomment-3252582
- name: Determine OLS Admin PHP Major/Minor Version
id: ols-admin-php-version
run: |
_0=$(echo ${{ matrix.OLS_ADMIN_PHP_VERSION }} | cut -d. -f1)
_1=$(echo ${{ matrix.OLS_ADMIN_PHP_VERSION }} | cut -d. -f2)
echo "_0=$_0" >> $GITHUB_OUTPUT
echo "_1=$_1" >> $GITHUB_OUTPUT
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Build Docker Image
uses: docker/build-push-action@v5
Expand All @@ -83,20 +71,20 @@ jobs:
PHP_VERSION=${{ matrix.PHP_VERSION }}
PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.OLS_ADMIN_PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.ols-admin-php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.ols-admin-php-version.outputs._1 }}
OLS_ADMIN_PHP_VERSION=${{ matrix.PHP_VERSION }}
OLS_ADMIN_PHP_MAJOR_VERSION=${{ steps.php-version.outputs._0 }}
OLS_ADMIN_PHP_MINOR_VERSION=${{ steps.php-version.outputs._1 }}
NODE_VERSION=${{ matrix.NODE_VERSION }}
load: true
push: false
tags: openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }}-adminlsphp${{ steps.ols-admin-php-version.outputs._0 }}${{ steps.ols-admin-php-version.outputs._1 }}
tags: openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }}
no-cache: ${{ github.event_name == 'workflow_dispatch' && true || false }}
cache-from: type=registry,ref=${{ env.REGISTRY }}/ndigitals/openlitespeed
cache-to: type=inline

- name: Test Docker Image
run: |
IMAGE=openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }}-adminlsphp${{ steps.ols-admin-php-version.outputs._0 }}${{ steps.ols-admin-php-version.outputs._1 }}
IMAGE=openlitespeed:${{ env.OLS_VERSION }}-lsphp${{ steps.php-version.outputs._0 }}${{ steps.php-version.outputs._1 }}-node${{ matrix.NODE_VERSION }}
echo -e 'Testing PHP Info Site...'
ID=$(docker run -d ${IMAGE})
sleep 5s
Expand Down

0 comments on commit 41d43fb

Please sign in to comment.