Skip to content

Commit

Permalink
Migrate to lighthouse.
Browse files Browse the repository at this point in the history
  • Loading branch information
winlinvip committed May 9, 2022
1 parent 954aca1 commit dc320cd
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 1 deletion.
35 changes: 34 additions & 1 deletion .github/workflows/release.yml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: "Release"
name: "Release SRS demo signaling"

on:
push:
Expand All @@ -16,6 +16,13 @@ jobs:
- name: Checkout repository
uses: actions/checkout@v2

# Generate variables like:
# SRS_DROPLET_EIP=1.2.3.4
- name: Build droplet variables
run: |
SRS_DROPLET_EIP=$(dig +short lh.ossrs.net)
echo "SRS_DROPLET_EIP=$SRS_DROPLET_EIP" >> $GITHUB_ENV
################################################################
# Build
# The github.ref is, for example, refs/tags/v1.0.52
Expand Down Expand Up @@ -49,3 +56,29 @@ jobs:
docker tag ossrs/signaling:$SRS_TAG registry.cn-hangzhou.aliyuncs.com/ossrs/signaling:$SRS_MAJOR
docker push --all-tags registry.cn-hangzhou.aliyuncs.com/ossrs/signaling
################################################################
# Execute command in a ssh, because ufw limit the rate.
- name: Restart the containers
env:
SEARCH_APIKEY: ${{ secrets.SEARCH_APIKEY }}
uses: appleboy/ssh-action@master
with:
host: ${{ env.SRS_DROPLET_EIP }}
username: root
key: ${{ secrets.DIGITALOCEAN_SSHKEY }}
port: 22
envs: SRS_TAG,SRS_MAJOR
timeout: 60s
command_timeout: 30m
script: |
#
#ufw allow 1989 # For SRS demo signaling service.
#
# Restart SRS signaling service
for ((i=0; i < 5; i++)); do
if [[ $(docker ps -af name=docs-signaling |wc -l) -eq 1 ]]; then echo "Killed"; break; fi;
docker rm -f docs-signaling; sleep 0.3;
done
docker run -d -it --restart always --name docs-signaling -p 1989:1989 \
registry.cn-hangzhou.aliyuncs.com/ossrs/signaling:$SRS_TAG
4 changes: 4 additions & 0 deletions main.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,10 @@ func main() {

http.Handle("/", http.FileServer(http.Dir(html)))

http.Handle("/sig/v1/versions", http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
w.Write([]byte("1.0"))
}))

// Key is name of room, value is Room
var rooms sync.Map
http.Handle("/sig/v1/rtc", websocket.Handler(func(c *websocket.Conn) {
Expand Down

0 comments on commit dc320cd

Please sign in to comment.