Merge pull request #54 from albertogeniola/develop #112
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Builder | |
env: | |
BUILD_ARGS: "" | |
MONITORED_FILES: "build.yaml config.yaml Dockerfile rootfs addon_web_ui" | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
build: | |
runs-on: ubuntu-latest | |
name: Build ${{ matrix.arch }} ${{ matrix.addon }} add-on | |
strategy: | |
matrix: | |
addon: ["meross_local_broker"] | |
arch: ["aarch64", "amd64", "armv7", "i386"] # "armhf" has been removed as this is now deprecated in HA | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3.0.2 | |
- name: Get information | |
id: info | |
uses: home-assistant/actions/helpers/info@master | |
with: | |
path: "./${{ matrix.addon }}" | |
- name: Login to GitHub Container Registry | |
if: env.BUILD_ARGS != '--test' | |
uses: docker/login-action@v2.0.0 | |
with: | |
registry: ghcr.io | |
username: ${{ github.repository_owner }} | |
password: ${{ secrets.GITHUB_TOKEN }} | |
- name: Setup Node | |
id: setup_node | |
uses: actions/setup-node@v4 | |
with: | |
node-version: 12 | |
cache: npm | |
cache-dependency-path: meross_local_broker/addon_web_ui/package-lock.json | |
- name: npm install and npm run build | |
working-directory: meross_local_broker/addon_web_ui | |
run: | | |
npm i | |
npm run-script build | |
- name: Build ${{ matrix.addon }} add-on for ${{ matrix.arch }} | |
uses: home-assistant/builder@2024.08.2 | |
with: | |
args: | | |
${{ env.BUILD_ARGS }} \ | |
--${{ matrix.arch }} \ | |
--target /data/${{ matrix.addon }} \ | |
--image "{arch}-meross_local_broker" \ | |
--docker-hub "ghcr.io/${{ github.repository_owner }}" \ | |
--addon |