-
Notifications
You must be signed in to change notification settings - Fork 6
52 lines (46 loc) · 1.62 KB
/
build-matter-openwrt-build.yaml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
name: build matter-openwrt-build container
on:
pull_request:
paths:
- .containers/matter-openwrt-build/**
- .github/workflows/build-matter-openwrt-build.yaml
push:
paths:
- .containers/matter-openwrt-build/**
- .github/workflows/build-matter-openwrt-build.yaml
workflow_dispatch:
inputs:
openwrt-version-override:
type: string
description: OpenWrt version number override
permissions:
packages: write
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v2
- name: Prepare meta-data
id: prepare
shell: bash
run: |
# Determine OPENWRT_VERSION from override input or Dockerfile
if [[ -n "${{ inputs.openwrt-version-override }}" ]]; then
echo "OPENWRT_VERSION=${{ inputs.openwrt-version-override }}"
else
grep '^ARG OPENWRT_VERSION=' .containers/matter-openwrt-build/Dockerfile | cut -c 5-
fi | tee -a "$GITHUB_ENV"
- name: Build and push
uses: elgohr/Publish-Docker-Github-Action@v5
with:
name: project-chip/matter-openwrt-build
context: .containers/matter-openwrt-build
buildargs: OPENWRT_VERSION
registry: ghcr.io
tags: "latest,${{ env.OPENWRT_VERSION }}"
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
no_push: ${{ github.repository_owner != 'project-chip' || github.event_name == 'pull_request' || github.event.ref != 'refs/heads/main' }}