-
Notifications
You must be signed in to change notification settings - Fork 3
53 lines (41 loc) · 2.23 KB
/
ci-cd.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
name: CI/CD
on: [pull_request, push, workflow_dispatch]
env:
DOCKER_BUILDKIT: 1
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
version: ['8.0', '8.1', '8.2', '8.3']
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Build
run: |
docker build --pull -t kooldev/php:${{ matrix.version }}-oci8-nginx ${{ matrix.version }}-oci8-nginx
docker build --pull -t kooldev/php:${{ matrix.version }}-oci8-nginx-prod ${{ matrix.version }}-oci8-nginx-prod
docker build --pull -t kooldev/php:${{ matrix.version }}-oci8-swoole-nginx ${{ matrix.version }}-oci8-swoole-nginx
docker build --pull -t kooldev/php:${{ matrix.version }}-oci8-swoole-nginx-prod ${{ matrix.version }}-oci8-swoole-nginx-prod
- name: Tests
run: |
docker run kooldev/php:${{ matrix.version }}-oci8-nginx php -r "extension_loaded('oci8') or die(1);"
docker run kooldev/php:${{ matrix.version }}-oci8-nginx-prod php -r "extension_loaded('oci8') or die(1);"
docker run kooldev/php:${{ matrix.version }}-oci8-nginx php -r "extension_loaded('oci8') or die(1);"
docker run kooldev/php:${{ matrix.version }}-oci8-nginx-prod php -r "extension_loaded('oci8') or die(1);"
docker run kooldev/php:${{ matrix.version }}-oci8-swoole-nginx php -r "extension_loaded('oci8') or die(1);"
docker run kooldev/php:${{ matrix.version }}-oci8-swoole-nginx-prod php -r "extension_loaded('oci8') or die(1);"
- name: Login to DockerHub
uses: docker/[email protected]
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-oci8'
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Push to DockerHub
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-oci8'
run: |
docker push kooldev/php:${{ matrix.version }}-oci8-nginx
docker push kooldev/php:${{ matrix.version }}-oci8-nginx-prod
docker push kooldev/php:${{ matrix.version }}-oci8-swoole-nginx
docker push kooldev/php:${{ matrix.version }}-oci8-swoole-nginx-prod