Litespeed 7 #17
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
name: "Litespeed 7" | |
on: | |
workflow_dispatch: | |
schedule: | |
- cron: '35 21 * * 3' | |
env: | |
# The default repo env will be 'ComputeStacks'; uppercase is not allowed. | |
GH_REPO: computestacks/cs-docker-wordpress | |
jobs: | |
build: | |
strategy: | |
matrix: | |
php_version: [ "7.4" ] | |
image: [ "ghcr.io/computestacks/cs-docker-wordpress", "cmptstks/wordpress" ] | |
runs-on: ubuntu-latest | |
permissions: | |
contents: read | |
packages: write | |
steps: | |
- name: Checkout repository | |
uses: actions/checkout@v4 | |
- name: Set up Docker Buildx | |
uses: docker/setup-buildx-action@v3 | |
- name: Log into Github Registry | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
registry: ghcr.io | |
username: ${{ github.actor }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Log into DockerHub | |
if: github.event_name != 'pull_request' | |
uses: docker/login-action@v3 | |
with: | |
username: ${{ secrets.DOCKERHUB_USERNAME }} | |
password: ${{ secrets.DOCKERHUB_TOKEN }} | |
- name: Extract metadata (tags, labels) for Docker | |
id: meta | |
uses: docker/metadata-action@v5 | |
with: | |
images: ${{ matrix.image }} | |
tags: | | |
php${{ matrix.php_version }}-litespeed | |
- name: Build and prepare to test | |
uses: docker/build-push-action@v5 | |
with: | |
context: litespeed/php${{ matrix.php_version }}/ | |
load: true | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
- name: Test container image | |
run: > | |
docker run --name=mysql -d \ | |
-e MARIADB_ROOT_PASSWORD=ch3ngeme \ | |
mariadb:10 | |
docker run --name=wptest -d \ | |
--network "container:mysql" \ | |
-e CS_AUTH_KEY=FcUpBTaoi746JbAdhWqJwtmXC0en1M3u \ | |
-e METADATA_SERVICE=http://localhost \ | |
-e METADATA_AUTH=foobar123 \ | |
-e WORDPRESS_DB_USER=root \ | |
-e WORDPRESS_DB_PASSWORD=ch3ngeme \ | |
-e WORDPRESS_DB_HOST=127.0.0.1 \ | |
-e WORDPRESS_DB_NAME=wptest \ | |
-e WORDPRESS_TITLE=blogger \ | |
-e WORDPRESS_PASSWORD=ch3ngeme \ | |
-e WORDPRESS_URL=localhost \ | |
-e [email protected] \ | |
-e WORDPRESS_USER=admin \ | |
${{ matrix.image }}:php${{ matrix.php_version }}-litespeed | |
bash ./scripts/container-health.sh wptest | |
- name: Build and push | |
id: build-and-push | |
uses: docker/build-push-action@v5 | |
with: | |
context: litespeed/php${{ matrix.php_version }}/ | |
push: ${{ github.event_name != 'pull_request' }} | |
tags: ${{ steps.meta.outputs.tags }} | |
labels: ${{ steps.meta.outputs.labels }} | |
cache-from: type=gha | |
cache-to: type=gha,mode=max |