Skip to content

Allow connections to remote controllers (TCP serial or ESPHome) #316

Allow connections to remote controllers (TCP serial or ESPHome)

Allow connections to remote controllers (TCP serial or ESPHome) #316

Workflow file for this run

name: Build and Release Images
on:
push:
branches:
- main
paths:
- .arg
pull_request:
types: [opened, synchronize, reopened]
workflow_dispatch:
inputs:
build-target:
description: Build Target
required: false
default: "+test"
type: choice
options:
- "+test"
- "+all"
zwave-js-version:
description: Z-Wave JS version
required: false
default: "latest"
zwave-js-server-version:
description: Z-Wave JS Server version
required: false
default: "latest"
npm-install-flags:
description: Extra `npm install` flags
required: false
type: string
push:
description: Push image to registries
required: true
default: false
type: boolean
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Install earthly
uses: earthly/actions-setup@43211c7a0eae5344d6d79fb4aaf209c8f8866203 # v1.0.13
- name: Set up QEMU
uses: docker/setup-qemu-action@ce360397dd3f832beb865e1373c09c0e9f86d70a # v4.0.0
- name: Login to Docker Hub
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Login to GitHub Container Registry
uses: docker/login-action@4907a6ddec9925e35a0a9e82d7399ccc52663121 # v4.1.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Checkout repository
uses: actions/checkout@de0fac2e4500dabe0009e67214ff5f5447ce83dd # v6.0.2
- name: Set workflow dispatch environment
if: github.event_name == 'workflow_dispatch'
run: |
zjsver=${{ github.event.inputs.zwave-js-version }}
zjssver=${{ github.event.inputs.zwave-js-server-version }}
npmflags=${{ github.event.inputs.npm-install-flags }}
printf 'EARTHLY_BUILD_ARGS=ZWAVE_JS_VERSION=%s,ZWAVE_JS_SERVER_VERSION=%s,NPM_INSTALL_EXTRA_FLAGS=%s\n' "${zjsver}" "${zjssver}" "${npmflags}" >> "${GITHUB_ENV}"
printf 'target=%s\n' "${{ github.event.inputs.build-target }}" >> "${GITHUB_ENV}"
- name: Set PR environment
if: github.event_name == 'pull_request'
run: |
printf 'target=+test\n' >> $GITHUB_ENV
- name: Set release environment
if: github.event_name == 'push'
run: |
printf 'target=+all\n' >> $GITHUB_ENV
- name: Build Images
run: earthly --ci ${{ env.target }}
- name: Push to Docker Hub
if: github.event_name == 'push' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push == 'true')
run: earthly --ci --push ${{ env.target }}
- name: Push to GitHub Container Registry
if: github.event_name == 'push' || github.event_name == 'pull_request' || (github.event_name == 'workflow_dispatch' && github.event.inputs.push == 'true')
run: earthly --ci --push ${{ env.target }} --REGISTRY=ghcr.io