Skip to content

Commit 457b9da

Browse files
authored
Merge pull request #16 from adrianZahra/newworkflows
Addition of new release and tag workflow files
2 parents 76b9302 + 4639b43 commit 457b9da

File tree

3 files changed

+74
-8
lines changed

3 files changed

+74
-8
lines changed
Lines changed: 11 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,17 @@
1-
name: Publish library package to npmjs
2-
on:
3-
push:
4-
tags:
5-
- "*"
1+
name: Scalable Pixel Streaming Frontend Release Workflow Pipeline
2+
3+
# Start our pipeline when we create a new tag on the master branch
4+
on:
5+
release:
6+
types: [published]
7+
68
jobs:
7-
build:
9+
# Build NPM Package
10+
build-npm:
811
runs-on: ubuntu-latest
912
defaults:
1013
run:
11-
working-directory: ./SPS
14+
working-directory: ./library
1215
steps:
1316
- uses: actions/checkout@v3
1417
- uses: actions/setup-node@v3
@@ -19,4 +22,4 @@ jobs:
1922
- run: npm run build
2023
- run: npm publish --access public
2124
env:
22-
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
25+
NODE_AUTH_TOKEN: ${{ secrets.NPM_TOKEN }}
Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Scalable Pixel Streaming Frontend Tag Workflow Pipeline
2+
3+
# Start our pipeline when we create a new tag on the master branch
4+
on:
5+
push:
6+
tags:
7+
- '*'
8+
9+
# Assign an environment variable that we can use for the version of the Scalable Pixel Streaming Frontend that we are tagging
10+
env:
11+
VERSION: ${{ github.ref_name }}
12+
DOCKER_USER: ${{ secrets.DOCKER_USERNAME }}
13+
DOCKER_TOKEN: ${{ secrets.DOCKER_ACCESS_KEY }}
14+
15+
jobs:
16+
17+
# Build Library
18+
build-library:
19+
20+
runs-on: ubuntu-latest
21+
22+
steps:
23+
24+
# remove unneeded pieces from runner to free up space
25+
- name: Free up some space
26+
run: |
27+
sudo rm -rf /usr/local/lib/android # will release about 10 GB if you don't need Android
28+
sudo rm -rf /usr/share/dotnet # will release about 20GB if you don't need .NET
29+
30+
# Clone the source code on the runner
31+
- name: Clone repository
32+
uses: actions/checkout@v3
33+
34+
# Login to Docker
35+
- name: Docker login
36+
run: docker login -u $DOCKER_USER -p $DOCKER_TOKEN
37+
38+
# Set up Node js for npm
39+
- name: Setup Nodejs
40+
uses: actions/setup-node@v3
41+
42+
# Build the Scalable Pixel Streaming Frontend Library and Example
43+
- name: Build SPS Frontend
44+
run: |
45+
cd ./examples/typescript
46+
npm run build-all
47+
48+
# Build the Scalable Pixel Streaming Frontend Docker image from the dist directories of the packages
49+
- name: Build the Scalable Pixel Streaming Frontend Docker image and push to Docker
50+
run: |
51+
docker build -t "tensorworks/sps-frontend:$VERSION" -f ./dockerfiles/sps-frontend.dockerfile .
52+
docker push "tensorworks/sps-frontend:$VERSION"
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
FROM nginx:1.21.6
2+
3+
RUN mkdir www
4+
WORKDIR /www
5+
6+
ADD examples/typescript/dist/. /www/
7+
8+
RUN rm /etc/nginx/nginx.conf
9+
RUN ln -s /etc/nginx/sps/nginx.conf /etc/nginx/nginx.conf
10+
11+
EXPOSE 80

0 commit comments

Comments
 (0)