Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -1,14 +1,17 @@
name: Publish library package to npmjs
on:
push:
tags:
- "*"
name: Scalable Pixel Streaming Frontend Release Workflow Pipeline

# Start our pipeline when we create a new tag on the master branch
on:
release:
types: [published]

jobs:
build:
# Build NPM Package
build-npm:
runs-on: ubuntu-latest
defaults:
run:
working-directory: ./SPS
working-directory: ./library
steps:
- uses: actions/checkout@v3
- uses: actions/setup-node@v3
Expand All @@ -19,4 +22,4 @@ jobs:
- run: npm run build
- run: npm publish --access public
env:
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
52 changes: 52 additions & 0 deletions .github/workflows/tag-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Scalable Pixel Streaming Frontend Tag Workflow Pipeline

# Start our pipeline when we create a new tag on the master branch
on:
push:
tags:
- '*'

# Assign an environment variable that we can use for the version of the Scalable Pixel Streaming Frontend that we are tagging
env:
VERSION: ${{ github.ref_name }}
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_ACCESS_KEY }}

jobs:

# Build Library
build-library:

runs-on: ubuntu-latest

steps:

# remove unneeded pieces from runner to free up space
- name: Free up some space
run: |
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET

# Clone the source code on the runner
- name: Clone repository
uses: actions/checkout@v3

# Login to Docker
- name: Docker login
run: docker login -u $DOCKER_USER -p $DOCKER_TOKEN

# Set up Node js for npm
- name: Setup Nodejs
uses: actions/setup-node@v3

# Build the Scalable Pixel Streaming Frontend Library and Example
- name: Build SPS Frontend
run: |
cd ./examples/typescript
npm run build-all

# Build the Scalable Pixel Streaming Frontend Docker image from the dist directories of the packages
- name: Build the Scalable Pixel Streaming Frontend Docker image and push to Docker
run: |
docker build -t "tensorworks/sps-frontend:$VERSION" -f ./dockerfiles/sps-frontend.dockerfile .
docker push "tensorworks/sps-frontend:$VERSION"
11 changes: 11 additions & 0 deletions dockerfiles/sps-frontend.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
FROM nginx:1.21.6

RUN mkdir www
WORKDIR /www

ADD examples/typescript/dist/. /www/

RUN rm /etc/nginx/nginx.conf
RUN ln -s /etc/nginx/sps/nginx.conf /etc/nginx/nginx.conf

EXPOSE 80