Skip to content
Merged
Show file tree
Hide file tree
Changes from 12 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 }}
56 changes: 56 additions & 0 deletions .github/workflows/tag-workflow.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
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 throughout the workflow for the version
# of SPS that we are tagging
env:
FRONTEND_VERSION: ${{ github.ref_name }}
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
DOCKER_TOKEN: ${{ secrets.DOCKER_ACCESS_KEY }}

jobs:

# Build Library
build-library:

runs-on: ubuntu-latest

env:
CLOUD_PROVIDER: aws

steps:

- 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 SPS Frontend
- name: Build SPS Frontend
run: |
cd /Frontend/examples/typescript
npm install
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-$CLOUD_PROVIDER" -f ./dockerfiles/sps-frontend.dockerfile .
docker push "tensorworks/sps-frontend:$VERSION-$CLOUD_PROVIDER"
12 changes: 12 additions & 0 deletions dockerfiles/sps-frontend.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@

FROM nginx:1.21.6

RUN mkdir www
WORKDIR /www

ADD /Frontend/examples/typescript/. /www/

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

EXPOSE 80