Skip to content

Docker Release - Test #42

Docker Release - Test

Docker Release - Test #42

name: Docker Release - Test
on:
workflow_dispatch:
inputs:
branch:
description: 'Branch'
required: true
tag:
description: 'Tag'
required: true
default: 'test'
jobs:
build-push:
permissions:
packages: write
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
with:
fetch-depth: 0 # fetch everything
ref: ${{ github.event.inputs.branch }}
- uses: actions/setup-node@v3.6.0
with:
node-version: 20
cache: 'npm'
- uses: docker/setup-buildx-action@v3
- uses: docker/setup-qemu-action@v3
- name: Login to dockerhub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to Github Packages
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Create Docker Meta
id: docker_meta
uses: docker/metadata-action@v5
with:
images: zwavejs/zwavejs2mqtt,zwavejs/zwave-js-ui,ghcr.io/zwave-js/zwave-js-ui
tags: |
${{ github.event.inputs.tag }}
flavor: |
latest=false
labels: |
org.opencontainers.image.vendor=zwave-js
org.opencontainers.image.documentation=https://zwave-js.github.io/zwave-js-ui/#/
org.opencontainers.image.authors=Daniel Lando <daniel.sorridi@gmail.com>
org.opencontainers.image.url=https://zwave-js.github.io/zwave-js-ui/#/
maintainer=robertsLando
- name: Pre-build frontend and backend files
run: |
npm ci
npm run build
- name: build+push
uses: docker/build-push-action@v5
timeout-minutes: 120
with:
platforms: linux/arm64,linux/amd64,linux/arm/v6,linux/arm/v7
file: docker/Dockerfile
context: . # without this it will use master instead of the selected branch
cache-from: type=gha
cache-to: type=gha,mode=max
push: true
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}