-
-
Notifications
You must be signed in to change notification settings - Fork 42
39 lines (37 loc) · 1.39 KB
/
build_preview.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
name: build_preview
on:
workflow_dispatch:
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:7.4 || true
- name: "[8.3] Build and push"
id: docker_build_83
uses: docker/build-push-action@v4
with:
push: true
file: 8.3.Dockerfile
tags: adhocore/lemp:8.3b
platforms: linux/amd64,linux/arm64
- name: "[8.3] Test"
run: |
docker run --name lemp83 adhocore/lemp:8.3b &
sleep 60
docker exec $(docker ps -q -f 'name=lemp83') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:25'
PORTS=$(docker exec $(docker ps -q -f 'name=lemp83') netstat -ant | grep -E '0:11300|0:11211|1:9300|1:9200|::9000|0:6379|1:5432|0:3306|0:88|0:25' | wc -l | xargs)
sleep 1 && docker stop lemp83 > /dev/null || true
[[ "10" == "$PORTS" ]] || { echo '[8.3] Not all ports are open' && exit 1; }