Skip to content

build_preview

build_preview #8

Workflow file for this run

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; }