-
Notifications
You must be signed in to change notification settings - Fork 33
58 lines (46 loc) · 1.84 KB
/
install-dockerfile-and-check-ssl.yml
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
name: Docker Build and Test
on:
workflow_dispatch:
inputs:
branch_name:
description: 'build branch name'
required: true
default: 'master'
jobs:
build:
runs-on: self-hosted
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: stop the AMS service
run: sudo systemctl stop antmedia
- name: Run Docker service
run: sudo systemctl restart docker
- name: Build Docker image
run: docker build -f docker/Dockerfile_Process --network=host -t antmediaserver --build-arg LicenseKey="${{ secrets.ENTERPRISE_LICENSE }}" .
- name: Run Docker container
run: docker run -d --name antmedia --network=host -it antmediaserver
- name: Clone branch
run: |
git clone --depth=1 -b ${{ inputs.branch_name }} https://github.com/ant-media/Ant-Media-Server.git || git clone --depth=1 https://github.com/ant-media/Ant-Media-Server.git
- name: Copy enable_ssl.sh from cloned branch to container
run: docker cp Ant-Media-Server/src/main/server/enable_ssl.sh antmedia:/usr/local/antmedia/enable_ssl.sh
- name: Run enable_ssl.sh inside container
run: docker exec antmedia bash /usr/local/antmedia/enable_ssl.sh
- name: Verify container is running
run: |
sleep 20
docker ps -f name=antmedia
if [ $(docker ps -f name=antmedia --format '{{.Names}}') != "antmedia" ]; then
echo "Container is not running"
exit 1
fi
- name: Test application
run: |
docker exec antmedia curl -f https://${{ secrets.CI_SSL_TEST_DOMAIN }}:5443
- name: Stop and remove container
if: ${{ always() }
run: |
docker stop antmedia
docker rm antmedia
sudo systemctl start antmedia