Skip to content

Build dev restreamer-ui #347

Build dev restreamer-ui

Build dev restreamer-ui #347

name: 'Build dev restreamer-ui'
on:
workflow_dispatch:
workflow_call:
schedule:
- cron: '37 4 * * *'
push:
branches:
- dev
jobs:
build-frontend:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
with:
ref: dev
- name: Set up Node.js
uses: actions/setup-node@v4
with:
node-version: '21'
- name: Build React App
run: |
yarn install
yarn build
env:
PUBLIC_URL: './'
- name: Upload React build as artifact
uses: actions/upload-artifact@v4
with:
name: restreamerui-dev-build
path: build/
build-docker:
needs: build-frontend
runs-on: [self-hosted]
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Download React build artifact
uses: actions/download-artifact@v4
with:
name: restreamerui-dev-build
path: build
- name: Docker meta
id: meta
uses: docker/metadata-action@v5
with:
images: |
datarhei/restreamer-ui
tags: |
type=raw,value=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: Login to DockerHub
if: github.event_name != 'pull_request'
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
builder: ${{ steps.buildx.outputs.name }}
context: .
file: ./Dockerfile.workflow
build-args: |
CADDY_IMAGE=caddy:2.7.6-alpine
platforms: linux/amd64,linux/arm64,linux/arm/v7
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}