Skip to content

Merge pull request #3394 from jeedom/hotfix/scenario-pdo-hydratation #550

Merge pull request #3394 from jeedom/hotfix/scenario-pdo-hydratation

Merge pull request #3394 from jeedom/hotfix/scenario-pdo-hydratation #550

name: Docker Hub Image CI Builder
on:
push:
# only trigger CI when push on following branches
branches:
- master
# this is to manually trigger the worklow
workflow_dispatch:
inputs:
logLevel:
description: 'Reason'
default: 'Manual launch'
jobs:
build:
runs-on: ubuntu-latest
strategy:
# do every matrix combination, don't stop on errors
fail-fast: false
max-parallel: 4
matrix:
debian: [bullseye, bookworm]
database: [0, 1]
steps:
- name: Check Out Repo
# Check out the repo, using current branch
# https://github.com/marketplace/actions/checkout
uses: actions/checkout@v6
- name: BRANCH name
# adding infos in the $GITHUB_ENV file and summary
# secret DOCKER_HUB_REPO is optional (default=jeedom)
id: config_tags
env:
DOCKER_HUB_REPO: ${{ secrets.DOCKER_HUB_REPO }}
TAG_SUFFIX: ${{ matrix.database && 'http-' || '' }}${{ matrix.debian }}
DEBIAN: ${{ matrix.debian }}
DATABASE: ${{ matrix.database }}
run: |
bash .github/scripts/init_workflow.sh
- name: Set up QEMU
# https://github.com/marketplace/actions/docker-setup-qemu
# set up more platforms (default = all)
uses: docker/setup-qemu-action@v4
with:
platforms: linux/amd64,linux/arm64 # ,linux/arm/v7
- name: Login to Docker Hub
# https://github.com/marketplace/actions/docker-login
# login to DockerHub with secrets login & token
uses: docker/login-action@v4
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }}
- name: Set up Docker Buildx
# https://github.com/marketplace/actions/docker-setup-buildx
# set up a multi-platform builder for Docker containers
id: buildx
uses: docker/setup-buildx-action@v4
- name: Cache Docker layers
# https://github.com/marketplace/actions/cache
# this action allows caching dependancies and build output
uses: actions/cache@v5
id: cache
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ matrix.debian }}
restore-keys: |
${{ runner.os }}-buildx-${{ matrix.debian }}
- name: Build and push Jeedom on Debian:${{ matrix.debian }} ${{ matrix.database && 'with' || 'without' }} internal DB
${{ runner.os }}-buildx-
# https://github.com/marketplace/actions/build-and-push-docker-images
uses: docker/build-push-action@v7
with:
context: ./
file: ./Dockerfile
push: true
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache
build-args: |
"VERSION=${{ steps.config_tags.outputs.GITHUB_BRANCH }}"
"DEBIAN=${{ matrix.debian }}"
"DATABASE=${{ matrix.database }}"
tags: "${{ steps.config_tags.outputs.JEEDOM_TAGS }}"