Skip to content

Commit

Permalink
Add docker workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
jstabenow committed Jun 3, 2022
1 parent d6c530e commit 4a521e9
Show file tree
Hide file tree
Showing 3 changed files with 64 additions and 1 deletion.
61 changes: 61 additions & 0 deletions .github/workflows/build_restreamer-ui.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
name: 'Build restreamer-ui'

on:
workflow_dispatch:
push:
branches-ignore:
- '**'

jobs:
docker:
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v2

- uses: cardinalby/export-env-action@v1
with:
envFile: '.github_build/Build.restreamer-ui.env'
export: 'true'
expandWithJobEnv: 'true'
expand: 'true'

- name: Set up QEMU
uses: docker/setup-qemu-action@master
with:
platforms: all

- name: Set up Docker Buildx
id: buildx
uses: docker/setup-buildx-action@master

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-
- name: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}

- name: Build Multi-Arch
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile
build-args: |
PUBLIC_URL=/ui
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: |
datarhei/restreamer-ui:${{ env.RELEASE }}
datarhei/restreamer-ui:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new
2 changes: 2 additions & 0 deletions .github_build/Build.restreamer-ui.env
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
# RESTREAMER UI
RELEASE=1.1.0
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ FROM node:17.9.0-alpine3.15
ARG NODE_SPACE_SIZE=10240
ENV NODE_OPTIONS="--openssl-legacy-provider --max-old-space-size=$NODE_SPACE_SIZE"

ENV PUBLIC_URL "/"
ARG PUBLIC_URL "/"

COPY . /ui

Expand Down

0 comments on commit 4a521e9

Please sign in to comment.