Skip to content

Merge branch 'v1.4-sve' into 'main' #492

Merge branch 'v1.4-sve' into 'main'

Merge branch 'v1.4-sve' into 'main' #492

Workflow file for this run

# Copyright 2022 Espressif Systems (Shanghai) PTE LTD
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
name: Build Docker
on:
push:
branches:
- 'main'
- 'release/*'
tags:
- 'v*.*'
# Can be run manually
workflow_dispatch:
env:
# Platforms to build the image for
# Github runner is running out of space when we are building for multiple architectures in single runner
BUILD_PLATFORMS: linux/amd64
DOCKERHUB_REPO: ${{ github.repository }}
REQUIRED_IDF_VERSION: v5.2.1
jobs:
build:
# Disable the job in forks
if: ${{ github.repository_owner == 'espressif' }}
runs-on: ubuntu-latest
steps:
# Workaround for disk space issues on the GitHub runner
- run: sudo rm -rf /usr/share/dotnet
- run: sudo rm -rf "$AGENT_TOOLSDIRECTORY"
# Depending on the branch/tag, set TAG_NAME (used when tagging the image).
#
# The following 3 steps cover the alternatives (tag, release branch, main branch):
- name: Set variables (tags)
if: ${{ github.ref_type == 'tag' }}
run: |
echo "TAG_NAME=$GITHUB_REF_NAME" >> $GITHUB_ENV
- name: Set variables (release branches)
if: ${{ github.ref_type == 'branch' && startsWith(github.ref_name, 'release/') }}
run: |
echo "TAG_NAME=release-${GITHUB_REF_NAME##release/}" >> $GITHUB_ENV
- name: Set variables (main branch)
if: ${{ github.ref_type == 'branch' && github.ref_name == 'main' }}
run: |
echo "TAG_NAME=latest" >> $GITHUB_ENV
# The following steps are the standard boilerplate from
# https://github.com/marketplace/actions/build-and-push-docker-images
- name: Checkout
uses: actions/checkout@v4
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USER }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Set up QEMU for multiarch builds
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Build and push
uses: docker/build-push-action@v5
with:
context: tools/docker/matter_builds
push: true
tags: |
${{ env.DOCKERHUB_REPO }}:${{ env.TAG_NAME }}
${{ env.DOCKERHUB_REPO }}:${{ env.TAG_NAME }}_idf_${{ env.REQUIRED_IDF_VERSION }}
platforms: ${{ env.BUILD_PLATFORMS }}
build-args: |
ESP_MATTER_CLONE_URL=${{ github.server_url }}/${{ github.repository }}.git
ESP_MATTER_CHECKOUT_REF=${{ github.ref_name }}
IDF_CHECKOUT_REF=${{ env.REQUIRED_IDF_VERSION }}