-
Notifications
You must be signed in to change notification settings - Fork 13
64 lines (60 loc) · 1.94 KB
/
main.yaml
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
name: GitHub CI
on:
pull_request:
push:
branches:
- 'main'
schedule:
- cron: 0 0 * * 0
defaults:
run:
shell: 'bash -Eeuo pipefail {0}'
jobs:
main:
runs-on: ubuntu-22.04
strategy:
matrix:
version:
- '5.1'
- '5.2'
- '5.3'
- '5.4'
- '5.5'
steps:
- uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4.1.1
- uses: docker/setup-buildx-action@f95db51fddba0c2d1ec667646a06c2ce06100226 # v3.0.0
- uses: docker/setup-qemu-action@68827325e0b33c7199eb31dd4e31fbe9023e06e3 # v3.0.0
- name: Docker login
uses: docker/login-action@343f7c4344506bcbf9b4de18042ae17996df046d # v3.0.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ github.token }}
- uses: docker/build-push-action@4a13e500e55cf31b7a5d59a38ab2040ab0f42f56 # v5.1.0
with:
push: true
pull: true
no-cache: true
platforms: linux/amd64,linux/arm64
tags: ghcr.io/${{ github.repository }}:${{ matrix.version }}
file: ${{ matrix.version }}/Dockerfile
context: ${{ matrix.version }}
- name: Check image
timeout-minutes: 1
run: |
docker pull ghcr.io/${{ github.repository }}:${{ matrix.version }}
docker run -d -p 18083:18083 --name emqx ghcr.io/${{ github.repository }}:${{ matrix.version }}
while ! curl -fs 127.0.0.1:18083/status > /dev/null; do
echo "waiting for emqx"
sleep 1
done
if ! docker exec -i emqx emqx ping; then
echo "emqx command not working"
exit 1
fi
if ! docker exec -i emqx emqx ctl status; then
echo "emqx ctl command not working"
exit 1
fi
echo "================================================================"
echo "emqx is running"