From cf8527a3ef75063d1e6e6082a4ae7d038b10479f Mon Sep 17 00:00:00 2001 From: Murat Ugur Eminoglu Date: Mon, 6 Jan 2025 10:47:22 +0300 Subject: [PATCH] Add Docker build and test workflow for supervisord --- .github/workflows/docker-test-supervisor.yml | 62 ++++++++++++++++++++ 1 file changed, 62 insertions(+) create mode 100644 .github/workflows/docker-test-supervisor.yml diff --git a/.github/workflows/docker-test-supervisor.yml b/.github/workflows/docker-test-supervisor.yml new file mode 100644 index 00000000..e49943a8 --- /dev/null +++ b/.github/workflows/docker-test-supervisor.yml @@ -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 }}