-
Notifications
You must be signed in to change notification settings - Fork 2
54 lines (45 loc) · 1.78 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
54
name: CI/CD
on: [push, workflow_dispatch]
env:
DOCKER_BUILDKIT: 1
jobs:
build:
name: Build
runs-on: ubuntu-latest
strategy:
matrix:
version: ['8.0', '8.1']
steps:
- name: Checkout code
uses: actions/[email protected]
- name: Build
run: |
docker build --pull -t kooldev/php:${{ matrix.version }}-nginx-swoole ${{ matrix.version }}-nginx-swoole
docker build --pull -t kooldev/php:${{ matrix.version }}-nginx-swoole-prod ${{ matrix.version }}-nginx-swoole-prod
- name: Tests
run: |
docker run kooldev/php:${{ matrix.version }}-nginx-swoole php -r "extension_loaded('swoole') or die(1);"
docker run kooldev/php:${{ matrix.version }}-nginx-swoole-prod php -r "extension_loaded('swoole') or die(1);"
- name: Login to DockerHub
uses: docker/[email protected]
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
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-swoole'
run: |
docker push kooldev/php:${{ matrix.version }}-nginx-swoole
docker push kooldev/php:${{ matrix.version }}-nginx-swoole-prod
trigger-build-oci8:
name: Trigger OCI8 Build
runs-on: ubuntu-latest
needs: build
steps:
- name: Trigger build on kool-dev/docker-php-oci8
uses: benc-uk/[email protected]
if: github.ref == 'refs/heads/main' && github.repository == 'kool-dev/docker-php-swoole'
with:
workflow: CI/CD
repo: kool-dev/docker-php-oci8
token: ${{ secrets.WORKFLOW_TOKEN }}