File tree Expand file tree Collapse file tree 1 file changed +72
-0
lines changed Expand file tree Collapse file tree 1 file changed +72
-0
lines changed Original file line number Diff line number Diff line change
1
+ name : Docker PHP Images GitHub workflow
2
+
3
+ on :
4
+ pull_request :
5
+ branches :
6
+ - ' v3'
7
+ push :
8
+ branches :
9
+ - ' v3'
10
+ schedule :
11
+ - cron : ' 0 0 * * 0'
12
+
13
+
14
+ jobs :
15
+ build_test_maybe_release :
16
+ strategy :
17
+ matrix :
18
+ include :
19
+ - variant : ' cli'
20
+ php_version : ' 7.4'
21
+ - variant : ' apache'
22
+ php_version : ' 7.4'
23
+ - variant : ' fpm'
24
+ php_version : ' 7.4'
25
+ - variant : ' cli'
26
+ php_version : ' 7.3'
27
+ - variant : ' apache'
28
+ php_version : ' 7.3'
29
+ - variant : ' fpm'
30
+ php_version : ' 7.3'
31
+ - variant : ' cli'
32
+ php_version : ' 7.2'
33
+ - variant : ' apache'
34
+ php_version : ' 7.2'
35
+ - variant : ' fpm'
36
+ php_version : ' 7.2'
37
+ - variant : ' cli'
38
+ php_version : ' 7.1'
39
+ - variant : ' apache'
40
+ php_version : ' 7.1'
41
+ - variant : ' fpm'
42
+ php_version : ' 7.1'
43
+ runs-on : ubuntu-latest
44
+ steps :
45
+ - name : Set up QEMU
46
+ uses : docker/setup-qemu-action@v1
47
+ - name : Set up Docker Buildx
48
+ uses : docker/setup-buildx-action@v1
49
+ - uses : actions/checkout@v1
50
+ - name : Build and test
51
+ uses : docker/build-push-action@v2
52
+ run : |
53
+ PHP_VERSION="${{ matrix.php_version }}" BRANCH="$GITHUB_REF_NAME_SLUG" VARIANT="${{ matrix.variant }}" ./build-and-test.sh
54
+ docker images | grep thecodingmachine/php
55
+ - name : Login to DockerHub
56
+ # Merge ~ push.
57
+ if : ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
58
+ uses : docker/login-action@v1
59
+ with :
60
+ username : ${{ secrets.DOCKERHUB_USERNAME }}
61
+ password : ${{ secrets.DOCKERHUB_TOKEN }
62
+ - name : Release
63
+ uses : docker/build-push-action@v2
64
+ # Merge ~ push.
65
+ if : ${{ github.event_name == 'push' || github.event_name == 'schedule' }}
66
+ run : |
67
+ BRANCH_VARIANT=`echo "${{ matrix.variant }}" | sed 's/\./-/g'`
68
+ docker push thecodingmachine/php:${{ matrix.php_version }}-${GITHUB_REF_NAME_SLUG}-slim-${BRANCH_VARIANT}
69
+ docker push thecodingmachine/php:${{ matrix.php_version }}-${GITHUB_REF_NAME_SLUG}-${BRANCH_VARIANT}
70
+ docker push thecodingmachine/php:${{ matrix.php_version }}-${GITHUB_REF_NAME_SLUG}-${BRANCH_VARIANT}-node8
71
+ docker push thecodingmachine/php:${{ matrix.php_version }}-${GITHUB_REF_NAME_SLUG}-${BRANCH_VARIANT}-node10
72
+ docker push thecodingmachine/php:${{ matrix.php_version }}-${GITHUB_REF_NAME_SLUG}-${BRANCH_VARIANT}-node12
You can’t perform that action at this time.
0 commit comments