-
Notifications
You must be signed in to change notification settings - Fork 0
128 lines (109 loc) · 3.83 KB
/
build-and-push.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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
name: "Deploy Image to DockerHub"
on:
workflow_dispatch:
push:
branches:
- master
env:
PLATFORMS: linux/arm64/v8,linux/amd64
jobs:
build_fpm:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: "8.2"
- php-version: "8.1"
- php-version: "7.4"
steps:
- name: "Checkout Sourcecode"
uses: actions/checkout@v3
- name: "Set up Docker Buildx"
id: builder
uses: docker/setup-buildx-action@v2
- name: "Append ARM buildx builder from AWS"
uses: baschny/append-buildx-action@v1
with:
builder: ${{ steps.builder.outputs.name }}
node_name: arm-${{ matrix.php-version }}-${{ matrix.node-version }}-${{ github.sha }}
endpoint: "ssh://[email protected]"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: "Login to DockerHub"
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Docker build and push (fpm image)"
uses: docker/build-push-action@v4
with:
tags: "croneu/phpapp-fpm:php-${{ matrix.php-version }}"
platforms: ${{ env.PLATFORMS }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
target: php-fpm
build-args: |
PHP_MINOR_VERSION=${{ matrix.php-version }}
- name: "Update Docker Hub Description (croneu/phpapp-fpm)"
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: croneu/phpapp-fpm
short-description: ${{ github.event.repository.description }} - PHP-FPM
build_ssh:
needs:
- build_fpm
runs-on: ubuntu-latest
strategy:
matrix:
include:
- php-version: "8.2"
node-version: "18"
- php-version: "8.1"
node-version: "16"
- php-version: "7.4"
node-version: "16"
- php-version: "7.4"
node-version: "14"
- php-version: "7.4"
node-version: "12"
- php-version: "7.4"
node-version: "10"
steps:
- name: "Checkout Sourcecode"
uses: actions/checkout@v3
- name: "Set up Docker Buildx"
id: builder
uses: docker/setup-buildx-action@v2
- name: "Append ARM buildx builder from AWS"
uses: baschny/append-buildx-action@v1
with:
builder: ${{ steps.builder.outputs.name }}
node_name: arm-${{ matrix.php-version }}-${{ matrix.node-version }}-${{ github.sha }}
endpoint: "ssh://[email protected]"
ssh_private_key: ${{ secrets.SSH_PRIVATE_KEY }}
- name: "Login to DockerHub"
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Docker build and push (ssh image)"
uses: docker/build-push-action@v4
with:
tags: "croneu/phpapp-ssh:php-${{ matrix.php-version }}-node-${{ matrix.node-version }}"
platforms: ${{ env.PLATFORMS }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
target: ssh
build-args: |
PHP_MINOR_VERSION=${{ matrix.php-version }}
NODE_VERSION=${{ matrix.node-version }}
- name: "Update Docker Hub Description (croneu/phpapp-ssh)"
uses: peter-evans/dockerhub-description@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
repository: croneu/phpapp-ssh
short-description: ${{ github.event.repository.description }} - SSH