Skip to content

Merge branch 'dev' of https://github.com/datarhei/restreamer-ui into dev #57

Merge branch 'dev' of https://github.com/datarhei/restreamer-ui into dev

Merge branch 'dev' of https://github.com/datarhei/restreamer-ui into dev #57

name: 'Build datarhei/restreamer-ui:dev-dev'
on:
push:
branches:
- dev
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Set up Node.js
uses: actions/setup-node@v2
with:
node-version: '21'
- name: Build React App
run: |
yarn install
yarn build
- name: Upload React build as artifact
uses: actions/upload-artifact@v2
with:
name: react-build
path: build/
build-docker:
needs: build-frontend
runs-on: [self-hosted]
strategy:
matrix:
platform: [linux/amd64, linux/arm64, linux/arm/v7]
steps:
- name: Checkout
uses: actions/checkout@v2
- name: Download React build artifact
uses: actions/download-artifact@v2
with:
name: react-build
path: build
- uses: actions-ecosystem/action-get-latest-tag@v1
id: get-latest-tag
with:
semver_only: true
- name: Docker meta
id: meta
uses: docker/metadata-action@v4
with:
images: |
datarhei/restreamer-ui
tags: |
type=raw,value=dev-dev
- 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 and Push Docker Image
uses: docker/build-push-action@v2
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile.workflow
build-args: |
PUBLIC_URL=/ui
platforms: ${{ matrix.platform }}
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new