Skip to content

Commit

Permalink
Add Docker build and test workflow for supervisord
Browse files Browse the repository at this point in the history
  • Loading branch information
muratugureminoglu authored Jan 6, 2025
1 parent 15c1838 commit cf8527a
Showing 1 changed file with 62 additions and 0 deletions.
62 changes: 62 additions & 0 deletions .github/workflows/docker-test-supervisor.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@

name: Ant Media Server Docker Test (Supervisor/No-Supervisor)
on: [push]
#on:
# push:
# branches:
# - main
# pull_request:
# branches:
# - main

jobs:
build-and-test:
runs-on: ubuntu-latest
strategy:
matrix:
use_supervisor: [false, true]

steps:
- name: Checkout Repository
uses: actions/checkout@v3

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2

- name: Build Docker Image
id: build-image
run: |
docker build \
--build-arg UseSupervisor=${{ matrix.use_supervisor }} \
--build-arg LicenseKey=${{ secrets.DOCKER_TEST_AMS_LICENSE_KEY }} \
-t my-docker-image:${{ github.run_id }}-${{ matrix.use_supervisor }} .
- name: Run Docker Container (No Supervisor)
if: ${{ matrix.use_supervisor == false }}
run: |
docker run --name test-container-${{ github.run_id }}-${{ matrix.use_supervisor }} \
-d my-docker-image:${{ github.run_id }}-${{ matrix.use_supervisor }}
sleep 10
docker logs test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}
docker inspect -f '{{.State.Running}}' test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}
docker stop test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}
docker rm test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}
- name: Run Docker Container (With Supervisor)
if: ${{ matrix.use_supervisor == true }}
run: |
docker run --name test-container-${{ github.run_id }}-${{ matrix.use_supervisor }} \
-d -e ENABLE_SUPERVISOR=true my-docker-image:${{ github.run_id }}-${{ matrix.use_supervisor }}
sleep 10
docker logs test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}
docker inspect -f '{{.State.Running}}' test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}
docker stop test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}
docker rm test-container-${{ github.run_id }}-${{ matrix.use_supervisor }}

0 comments on commit cf8527a

Please sign in to comment.