-
Notifications
You must be signed in to change notification settings - Fork 32
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add Docker build and test workflow for supervisord
- Loading branch information
1 parent
15c1838
commit cf8527a
Showing
1 changed file
with
62 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 }} |