-
Notifications
You must be signed in to change notification settings - Fork 18
108 lines (89 loc) · 3.17 KB
/
test_and_publish.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
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
# #
# # This action will publish EasyEngine docker image.
# # This is set to publish images when tags are created,
# # and test them by just building them on PR.
# #
name: Test & Publish EE docker images
on:
pull_request:
push:
tags:
- v*
jobs:
php: #----------------------------------------------------------------------
runs-on: ubuntu-latest
name: Build and push PHP ${{ matrix.php }}
strategy:
fail-fast: false
matrix:
php: ['7.4', '8.0', '8.1', '8.2', '8.3', '8.4']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Img tag
id: img-tag
run: |
PHP=${{ matrix.php }}
echo "tag=${PHP/stable/}" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build PHP - ${{ matrix.php }} image
uses: docker/build-push-action@v6
if: github.event_name == 'pull_request'
with:
context: php/${{ matrix.php }}
tags: easyengine/php${{ steps.img-tag.outputs.tag }}:test
- name: Build and push PHP - ${{ matrix.php }} image
uses: docker/build-push-action@v6
if: github.event_name != 'pull_request'
with:
context: php/${{ matrix.php }}
push: true
tags: easyengine/php${{ steps.img-tag.outputs.tag }}:${{ steps.tag.outputs.tag }}
other-images: #----------------------------------------------------------------------
runs-on: ubuntu-latest
name: Build and push ${{ matrix.others }}
strategy:
fail-fast: false
matrix:
others: ['nginx', 'nginx-proxy', 'postfix', 'redis', 'cron', 'mailhog', 'mariadb', 'newrelic-daemon']
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Get tag
id: tag
run: echo "tag=${GITHUB_REF/refs\/tags\//}" >> $GITHUB_OUTPUT
- name: Login to DockerHub
uses: docker/login-action@v3
if: github.event_name != 'pull_request'
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Build ${{ matrix.others }} image
uses: docker/build-push-action@v6
if: github.event_name == 'pull_request'
with:
context: ${{ matrix.others }}
tags: easyengine/${{ matrix.others }}:test
- name: Build and push ${{ matrix.others }} image
uses: docker/build-push-action@v6
if: github.event_name != 'pull_request'
with:
context: ${{ matrix.others }}
push: true
tags: easyengine/${{ matrix.others }}:${{ steps.tag.outputs.tag }}