Skip to content

Commit

Permalink
ci: add stable release script
Browse files Browse the repository at this point in the history
Signed-off-by: Ariel Gentile <gentilester@gmail.com>
  • Loading branch information
genaris committed Sep 10, 2024
1 parent babe4e2 commit 9e472f8
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 4 deletions.
50 changes: 50 additions & 0 deletions .github/workflows/stable-release.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
name: Stable release
on:
push:
tags:
- "*"
env:
DH_USERNAME: ${{secrets.DOCKER_HUB_LOGIN}}
DH_TOKEN: ${{secrets.DOCKER_HUB_PWD}}
IMAGE_NAME: 'webrtc-server'
jobs:
build-and-push:
name: Build and push docker images
runs-on: ubuntu-latest

steps:
- name: Checkout webrtc-server
uses: actions/checkout@v4

- name: Setup node v20
uses: actions/setup-node@v4
with:
node-version: 20

- id: get_version
uses: battila7/get-version-action@v2

- name: Install dependencies
run: |
npm install
- name: Log in to Docker Hub
if: steps.get_version.outputs.is-semver == 'true'
run: |
echo "$DH_TOKEN" | docker login -u "$DH_USERNAME" --password-stdin
- name: Build Docker image
if: steps.get_version.outputs.is-semver == 'true'
run: |
docker build -f Dockerfile -t $DH_USERNAME/$IMAGE_NAME:${{steps.get_version.outputs.version}} .
- name: Add tags to Docker image and push to Docker Hub
if: steps.get_version.outputs.is-semver == 'true'
run: |
docker tag $DH_USERNAME/$IMAGE_NAME:${{steps.get_version.outputs.version}} $DH_USERNAME/$IMAGE_NAME:v${{steps.get_version.outputs.major}}
docker tag $DH_USERNAME/$IMAGE_NAME:${{steps.get_version.outputs.version}} $DH_USERNAME/$IMAGE_NAME:v${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}}
docker tag $DH_USERNAME/$IMAGE_NAME:${{steps.get_version.outputs.version}} $DH_USERNAME/$IMAGE_NAME:v${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}}.${{steps.get_version.outputs.patch}}
docker tag $DH_USERNAME/$IMAGE_NAME:${{steps.get_version.outputs.version}} $DH_USERNAME/$IMAGE_NAME:v${{steps.get_version.outputs.version-without-v}}
docker push $DH_USERNAME/$IMAGE_NAME:v${{steps.get_version.outputs.major}}
docker push $DH_USERNAME/$IMAGE_NAME:v${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}}
docker push $DH_USERNAME/$IMAGE_NAME:v${{steps.get_version.outputs.major}}.${{steps.get_version.outputs.minor}}.${{steps.get_version.outputs.patch}}
docker push $DH_USERNAME/$IMAGE_NAME:${{steps.get_version.outputs.version}}
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# WebRTC Server with Mediasoup, Docker, Kubernetes and Turn Server

This application, based on [Mediasoup-demo v3](https://github.com/versatica/mediasoup-demo/tree/v3), has been extensively modified and customized for the 2060 project to include a TURN server, specifically Coturn.
This application, based on [Mediasoup-demo v3](https://github.com/versatica/mediasoup-demo/tree/v3), has been extensively modified and customized for 2060 to include a TURN server, specifically Coturn.

You can deploy the demo using Docker or Kubernetes, with integration of the [Coturn](https://github.com/coturn/coturn) server for TURN functionality.
You can deploy it using Docker or Kubernetes, with integration of the [Coturn](https://github.com/coturn/coturn) server for TURN functionality.

## Table of Contents

Expand Down Expand Up @@ -91,9 +91,9 @@ docker build . -t 2060-webrtc-server:test

Should the start.sh script fail to detect the container's IP address, you may modify the Dockerfile by replacing CMD ["sh", "/service/start.sh"] with CMD ["node", "/service/server.js"]. Subsequently, manually set the MEDIASOUP_ANNOUNCED_IP variable.

You are required to generate the certificates private-key.pem and public-certificate.pem and store them in a directory accessible to the application. While the default directory is certificates, you have the flexibility to specify an alternative directory name by configuring the HTTPS_CERTIFICATES_PATH environment variable.
You are required to generate a certificate and place both its public and private part in PEM format in a directory reachable by the application. The full path must be set on `HTTPS_CERT_FULLCHAIN` and `HTTPS_CERT_PRIVKEY` environment variable respectively.

Certificates can be created using OpenSSL with the execution of the following commands:
Certificate can be created using OpenSSL with the execution of the following commands:

```bash
openssl genpkey -algorithm RSA -out privkey.pem
Expand Down

0 comments on commit 9e472f8

Please sign in to comment.