-
Notifications
You must be signed in to change notification settings - Fork 1
93 lines (81 loc) · 2.87 KB
/
litespeed-7.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
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