-
-
Notifications
You must be signed in to change notification settings - Fork 42
78 lines (74 loc) · 3.2 KB
/
build.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
name: build
on:
workflow_dispatch:
push:
branches:
- 'main'
jobs:
docker:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up QEMU
uses: docker/setup-qemu-action@v2
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: "Docker Pull"
run: |
docker pull adhocore/phpfpm:8.0 || true
docker pull adhocore/phpfpm:8.1 || true
docker pull adhocore/phpfpm:8.2 || true
- name: "[8.2] Build and push"
id: docker_build_82
uses: docker/build-push-action@v4
with:
push: true
file: 8.2.Dockerfile
tags: adhocore/lemp:8.2,adhocore/lemp:latest
platforms: linux/amd64,linux/arm64
- name: "[8.1] Build and push"
id: docker_build_81
uses: docker/build-push-action@v4
with:
push: true
file: 8.1.Dockerfile
tags: adhocore/lemp:8.1
platforms: linux/amd64,linux/arm64
- name: "[8.0] Build and push"
id: docker_build_80
uses: docker/build-push-action@v4
with:
push: true
file: 8.0.Dockerfile
tags: adhocore/lemp:8.0
platforms: linux/amd64,linux/arm64
- name: "[8.2] Test"
run: |
docker run --name lemp82 adhocore/lemp:8.2 &
sleep 60
docker exec $(docker ps -q -f 'name=lemp82') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25'
PORTS=$(docker exec $(docker ps -q -f 'name=lemp82') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25' | wc -l | xargs)
sleep 1 && docker stop lemp82 > /dev/null || true
[[ "11" == "$PORTS" ]] || { echo '[8.2] Not all ports are open' && exit 1; }
- name: "[8.1] Test"
run: |
docker run --name lemp81 adhocore/lemp:8.1 &
sleep 60
docker exec $(docker ps -q -f 'name=lemp81') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25'
PORTS=$(docker exec $(docker ps -q -f 'name=lemp81') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25' | wc -l | xargs)
sleep 1 && docker stop lemp81 > /dev/null || true
[[ "11" == "$PORTS" ]] || { echo '[8.1] Not all ports are open' && exit 1; }
- name: "[8.0] Test"
run: |
docker run --name lemp80 adhocore/lemp:8.0 &
sleep 60
docker exec $(docker ps -q -f 'name=lemp80') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25'
PORTS=$(docker exec $(docker ps -q -f 'name=lemp80') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:80|0:25' | wc -l | xargs)
sleep 1 && docker stop lemp80 > /dev/null || true
[[ "11" == "$PORTS" ]] || { echo '[8.0] Not all ports are open' && exit 1; }