mirror of
https://github.com/buanet/ioBroker.docker.git
synced 2025-12-25 17:54:11 +02:00
151 lines
6.1 KiB
YAML
151 lines
6.1 KiB
YAML
# Github action to build Debian12 image (Tag: latest)
|
|
name: Build Debian 12 Image (latest)
|
|
|
|
on:
|
|
release:
|
|
types: [released]
|
|
workflow_dispatch:
|
|
|
|
jobs:
|
|
build-latest-for-buanet:
|
|
name: Build latest image for buanet
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fetch latest release tag
|
|
run: |
|
|
LATESTRELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.docker/releases/latest | jq -r '.tag_name')"
|
|
echo "Latest release tag : $LATESTRELEASE"
|
|
echo "RELEASE_TAG=$LATESTRELEASE" >> $GITHUB_ENV
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4.1.1
|
|
with:
|
|
repository: 'buanet/ioBroker.docker'
|
|
ref: ${{ env.RELEASE_TAG }}
|
|
|
|
- name: Set job variables
|
|
run: |
|
|
VERSION="$(cat .VERSION)"
|
|
MAJORVERSION="$(cat .VERSION | cut -c 1-2 | sed -r 's#^(.{0})#\1latest-#')"
|
|
DATI="$(date --rfc-3339=seconds | sed 's/ /T/')"
|
|
# Log output and export as Github environment variable
|
|
echo "[LOG] Nodejs Version: ${{ vars.RECOMMENDED_NODE_VERSION }}"
|
|
echo "[LOG] Image Version: $VERSION"
|
|
echo "version=$VERSION" >> $GITHUB_ENV
|
|
echo "[LOG] Major Image Version: $MAJORVERSION"
|
|
echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV
|
|
echo "[LOG] Buildnumber/Timestamp: $DATI"
|
|
echo "dati=$DATI" >> $GITHUB_ENV
|
|
# Set values in iobroker_startup.sh
|
|
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian12/scripts/iobroker_startup.sh > ./debian12/scripts/iobroker_startup.tmp
|
|
mv -f ./debian12/scripts/iobroker_startup.tmp ./debian12/scripts/iobroker_startup.sh
|
|
# Set values in Dockerfile
|
|
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" -e "s/\${NODE}/${{ vars.RECOMMENDED_NODE_VERSION }}/" ./debian12/Dockerfile > ./debian12/Dockerfile.tmp
|
|
mv -f ./debian12/Dockerfile.tmp ./debian12/Dockerfile
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
|
|
- name: Login to DockerHub (buanet)
|
|
uses: docker/login-action@v3.0.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER }}
|
|
password: ${{ secrets.DOCKER_PASS }}
|
|
|
|
- name: Login to GitHub Container Registry
|
|
uses: docker/login-action@v3.0.0
|
|
with:
|
|
registry: ghcr.io
|
|
username: ${{ secrets.PACKAGES_USER }}
|
|
password: ${{ secrets.PACKAGES_PASS }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5.1.0
|
|
with:
|
|
context: ./debian12
|
|
file: ./debian12/Dockerfile
|
|
push: true
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm/v7
|
|
linux/arm64/v8
|
|
tags: |
|
|
buanet/iobroker:latest,
|
|
buanet/iobroker:${{ env.majorversion }},
|
|
buanet/iobroker:${{ env.version }},
|
|
ghcr.io/buanet/iobroker:latest,
|
|
ghcr.io/buanet/iobroker:${{ env.majorversion }},
|
|
ghcr.io/buanet/iobroker:${{ env.version }}
|
|
provenance: false
|
|
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
|
|
|
|
build-latest-for-iobroker:
|
|
name: Build latest image for iobroker
|
|
runs-on: ubuntu-latest
|
|
steps:
|
|
- name: Fetch latest release tag
|
|
run: |
|
|
LATESTRELEASE="$(curl -sL https://api.github.com/repos/buanet/ioBroker.docker/releases/latest | jq -r '.tag_name')"
|
|
echo "Latest release tag : $LATESTRELEASE"
|
|
echo "RELEASE_TAG=$LATESTRELEASE" >> $GITHUB_ENV
|
|
|
|
- name: Checkout repo
|
|
uses: actions/checkout@v4.1.1
|
|
with:
|
|
repository: 'buanet/ioBroker.docker'
|
|
ref: ${{ env.RELEASE_TAG }}
|
|
|
|
- name: Set job variables
|
|
run: |
|
|
VERSION="$(cat .VERSION)"
|
|
MAJORVERSION="$(cat .VERSION | cut -c 1-2 | sed -r 's#^(.{0})#\1latest-#')"
|
|
DATI="$(date --rfc-3339=seconds | sed 's/ /T/')"
|
|
# Log output and export as Github environment variable
|
|
echo "[LOG] Nodejs Version: ${{ vars.RECOMMENDED_NODE_VERSION }}"
|
|
echo "[LOG] Image Version: $VERSION"
|
|
echo "version=$VERSION" >> $GITHUB_ENV
|
|
echo "[LOG] Major Image Version: $MAJORVERSION"
|
|
echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV
|
|
echo "[LOG] Buildnumber/Timestamp: $DATI"
|
|
echo "dati=$DATI" >> $GITHUB_ENV
|
|
# Set values in iobroker_startup.sh
|
|
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian12/scripts/iobroker_startup.sh > ./debian12/scripts/iobroker_startup.tmp
|
|
mv -f ./debian12/scripts/iobroker_startup.tmp ./debian12/scripts/iobroker_startup.sh
|
|
# Set values in Dockerfile
|
|
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" -e "s/\${NODE}/${{ vars.RECOMMENDED_NODE_VERSION }}/" ./debian12/Dockerfile > ./debian12/Dockerfile.tmp
|
|
mv -f ./debian12/Dockerfile.tmp ./debian12/Dockerfile
|
|
|
|
- name: Set up QEMU
|
|
uses: docker/setup-qemu-action@v3.0.0
|
|
|
|
- name: Set up Docker Buildx
|
|
id: buildx
|
|
uses: docker/setup-buildx-action@v3.0.0
|
|
|
|
- name: Login to DockerHub (buanet)
|
|
uses: docker/login-action@v3.0.0
|
|
with:
|
|
username: ${{ secrets.DOCKER_USER_IOB }}
|
|
password: ${{ secrets.DOCKER_PASS_IOB }}
|
|
|
|
- name: Build and push Docker image
|
|
uses: docker/build-push-action@v5.1.0
|
|
with:
|
|
context: ./debian12
|
|
file: ./debian12/Dockerfile
|
|
push: true
|
|
platforms: |
|
|
linux/amd64
|
|
linux/arm/v7
|
|
linux/arm64/v8
|
|
tags: |
|
|
iobroker/iobroker:latest,
|
|
iobroker/iobroker:${{ env.majorversion }},
|
|
iobroker/iobroker:${{ env.version }},
|
|
provenance: false
|
|
outputs: type=image,name=target,annotation-index.org.opencontainers.image.description=Official Docker image for ioBroker smarthome software (https://www.iobroker.net)
|