Merge pull request #1 from jambonz/gh-actions

Gh actions
This commit is contained in:
Dave Horton
2022-09-13 10:47:11 +02:00
committed by GitHub
4 changed files with 85 additions and 15 deletions

51
.github/workflows/docker-publish.yml vendored Normal file
View File

@@ -0,0 +1,51 @@
name: Docker
on:
push:
# Publish `master` as Docker `latest` image.
branches:
- main
# Publish `v1.2.3` tags as releases.
tags:
- v*
env:
IMAGE_NAME: sbc-inbound
jobs:
push:
runs-on: ubuntu-latest
if: github.event_name == 'push'
steps:
- uses: actions/checkout@v2
- name: Build image
run: docker build . --file Dockerfile --tag $IMAGE_NAME
- name: Log into registry
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
- name: Push image
run: |
IMAGE_ID=ghcr.io/${{ github.repository_owner }}/$IMAGE_NAME
# Change all uppercase to lowercase
IMAGE_ID=$(echo $IMAGE_ID | tr '[A-Z]' '[a-z]')
# Strip git ref prefix from version
VERSION=$(echo "${{ github.ref }}" | sed -e 's,.*/\(.*\),\1,')
# Strip "v" prefix from tag name
[[ "${{ github.ref }}" == "refs/tags/"* ]] && VERSION=$(echo $VERSION | sed -e 's/^v//')
# Use Docker `latest` tag convention
[ "$VERSION" == "main" ] && VERSION=latest
echo IMAGE_ID=$IMAGE_ID
echo VERSION=$VERSION
docker tag $IMAGE_NAME $IMAGE_ID:$VERSION
docker push $IMAGE_ID:$VERSION

19
.github/workflows/npm-ci.yml vendored Normal file
View File

@@ -0,0 +1,19 @@
name: CI
on:
push:
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: actions/setup-node@v1
with:
node-version: 16.x
- run: npm ci
- run: npm run jslint
- run: npm test

20
package-lock.json generated
View File

@@ -1,20 +1,20 @@
{
"name": "sbc-outbound-handler",
"name": "sbc-sip-sidecar",
"version": "0.0.1",
"lockfileVersion": 2,
"requires": true,
"packages": {
"": {
"name": "sbc-outbound-handler",
"name": "sbc-sip-sidecar",
"version": "0.0.1",
"license": "ISC",
"dependencies": {
"@jambonz/db-helpers": "^0.6.18",
"@jambonz/http-authenticator": "^0.2.1",
"@jambonz/http-authenticator": "^0.2.2",
"@jambonz/mw-registrar": "^0.2.2",
"@jambonz/realtimedb-helpers": "^0.4.29",
"@jambonz/stats-collector": "^0.1.6",
"@jambonz/time-series": "^0.1.12",
"@jambonz/time-series": "^0.2.0",
"debug": "^4.3.4",
"drachtio-mw-registration-parser": "^0.1.0",
"drachtio-mw-response-time": "^1.0.2",
@@ -329,9 +329,9 @@
}
},
"node_modules/@jambonz/time-series": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/@jambonz/time-series/-/time-series-0.1.12.tgz",
"integrity": "sha512-TmCG4jcI8oK3NXOc4/PbdRhhMVLEr5FOyG4IIWpNlwB0vbjAGLY3K+O5PF4fXK+UcNYnIrUcrd2C0J9z3+YBxw==",
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@jambonz/time-series/-/time-series-0.2.0.tgz",
"integrity": "sha512-yuZKZjSU0txB0YDHYuTF9JU5alysD33QbpkI+XxLiWD6Dn0RbGcO1LSDolCP94jDFxqPh3aJbI0/wDsTBYkpaA==",
"dependencies": {
"debug": "^4.3.1",
"influx": "^5.9.3"
@@ -3806,9 +3806,9 @@
}
},
"@jambonz/time-series": {
"version": "0.1.12",
"resolved": "https://registry.npmjs.org/@jambonz/time-series/-/time-series-0.1.12.tgz",
"integrity": "sha512-TmCG4jcI8oK3NXOc4/PbdRhhMVLEr5FOyG4IIWpNlwB0vbjAGLY3K+O5PF4fXK+UcNYnIrUcrd2C0J9z3+YBxw==",
"version": "0.2.0",
"resolved": "https://registry.npmjs.org/@jambonz/time-series/-/time-series-0.2.0.tgz",
"integrity": "sha512-yuZKZjSU0txB0YDHYuTF9JU5alysD33QbpkI+XxLiWD6Dn0RbGcO1LSDolCP94jDFxqPh3aJbI0/wDsTBYkpaA==",
"requires": {
"debug": "^4.3.1",
"influx": "^5.9.3"

View File

@@ -1,7 +1,7 @@
{
"name": "sbc-outbound-handler",
"name": "sbc-sip-sidecar",
"version": "0.0.1",
"description": "SBC Outbound Handler",
"description": "SBC SIP sidecar app (handles REGISTER and OPTIONS)",
"main": "app.js",
"engines": {
"node": ">= 14.0.0"
@@ -28,14 +28,14 @@
"homepage": "https://github.com/xquanluu/sbc-outbound-handler#readme",
"dependencies": {
"@jambonz/db-helpers": "^0.6.18",
"@jambonz/http-authenticator": "^0.2.1",
"@jambonz/http-authenticator": "^0.2.2",
"@jambonz/mw-registrar": "^0.2.2",
"@jambonz/realtimedb-helpers": "^0.4.29",
"@jambonz/stats-collector": "^0.1.6",
"@jambonz/time-series": "^0.1.12",
"@jambonz/time-series": "^0.2.0",
"debug": "^4.3.4",
"drachtio-mw-registration-parser": "^0.1.0",
"drachtio-mw-response-time": "^1.0.2",
"@jambonz/realtimedb-helpers": "^0.4.29",
"drachtio-srf": "^4.5.17",
"pino": "^6.14.0"
},