Skip to content

Commit

Permalink
add github action
Browse files Browse the repository at this point in the history
  • Loading branch information
buanet committed Sep 21, 2021
1 parent 07d15bc commit edd9c5e
Show file tree
Hide file tree
Showing 3 changed files with 117 additions and 2 deletions.
4 changes: 2 additions & 2 deletions .github/workflows/build-debian-image-main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,7 @@ jobs:
id: buildx
uses: docker/[email protected]

- name: Login to DockerHub
- name: Login to DockerHub (buanet)
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USER }}
Expand Down Expand Up @@ -96,7 +96,7 @@ jobs:
buanet/iobroker:${{ env.version }}-arm64v8,
ghcr.io/buanet/iobroker:${{ env.version }}-arm64v8
- name: Create and push manifests
- name: Create and push manifests (buanet)
run: |
sed -e "s/\${VERSION}/${{ env.version }}/g" -e "s/\${DOCKERTAG}/latest/g" ./manifest.yml > manifest_latest.yaml
./manifest-tool --username ${{ secrets.DOCKER_USER }} --password ${{ secrets.DOCKER_PASS }} push from-spec manifest_latest.yaml
Expand Down
96 changes: 96 additions & 0 deletions .github/workflows/build-debian-image-main_iob.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,96 @@
# Github action to build Docker image from main branch for iobroker/iobroker (tag: latest)
name: Build debian based image (latest)

on:
workflow_dispatch:
release:
types:
- published
schedule:
- cron: '42 3 * * 5'

jobs:
bulid-latest-image:
runs-on: ubuntu-latest
steps:
- name: Checkout repo (main)
uses: actions/[email protected]
with:
repository: 'buanet/ioBroker.docker'
ref: 'main'

- name: Get and write version and date
id: version
run: |
VERSION="$(cat .VERSION)"
MAJORVERSION="$(cat .VERSION | cut -c 1-2 | sed -r 's#^(.{0})#\1latest-#')"
DATI="$(date --rfc-3339=seconds | sed 's/ /T/')"
echo "This is the Version: $VERSION"
echo "version=$VERSION" >> $GITHUB_ENV
echo "This is the Major Version: $MAJORVERSION"
echo "majorversion=$MAJORVERSION" >> $GITHUB_ENV
echo "This is the Buildnumber/Timestamp: $DATI"
echo "dati=$DATI" >> $GITHUB_ENV
# startup script
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${BUILD}/$DATI/" ./debian/scripts/iobroker_startup.sh > ./debian/scripts/iobroker_startup.tmp
mv -f ./debian/scripts/iobroker_startup.tmp ./debian/scripts/iobroker_startup.sh
# amd64
sed -e "s/\${VERSION}/$VERSION/" -e "s/\${DATI}/$DATI/" ./debian/node12/Dockerfile > ./debian/node12/Dockerfile.tmp
mv -f ./debian/node12/Dockerfile.tmp ./debian/node12/Dockerfile
- name: Set up manifest tool
run: |
wget https://github.com/estesp/manifest-tool/releases/download/v0.7.0/manifest-tool-linux-amd64 -O manifest-tool
chmod +x manifest-tool
- name: Set up QEMU
uses: docker/[email protected]

- name: Set up Docker Buildx
id: buildx
uses: docker/[email protected]

- name: Login to DockerHub (iobroker)
uses: docker/[email protected]
with:
username: ${{ secrets.DOCKER_USER_IOB }}
password: ${{ secrets.DOCKER_PASS_IOB }}

- name: Build Docker image (amd64)
uses: docker/[email protected]
with:
context: ./debian
file: ./debian/node12/Dockerfile
push: true
platforms: linux/amd64
tags: |
iobroker/iobroker:${{ env.version }}-amd64,
- name: Build Docker image (arm32v7)
uses: docker/[email protected]
with:
context: ./debian
file: ./debian/node12/Dockerfile
push: true
platforms: linux/arm/v7
tags: |
iobroker/iobroker:${{ env.version }}-arm32v7,
- name: Build Docker image (arm64v8)
uses: docker/[email protected]
with:
context: ./debian
file: ./debian/node12/Dockerfile
push: true
platforms: linux/arm64/v8
tags: |
iobroker/iobroker:${{ env.version }}-arm64v8,
- name: Create and push manifests (iobroker)
run: |
sed -e "s/\${VERSION}/${{ env.version }}/g" -e "s/\${DOCKERTAG}/latest/g" ./manifest_iob.yml > manifest_latest_iob.yaml
./manifest-tool --username ${{ secrets.DOCKER_USER_IOB }} --password ${{ secrets.DOCKER_PASS_IOB }} push from-spec manifest_latest_iob.yaml
sed -e "s/\${VERSION}/${{ env.version }}/g" -e "s/\${DOCKERTAG}/${{ env.majorversion }}/g" ./manifest_iob.yml > manifest_majorversion_iob.yaml
./manifest-tool --username ${{ secrets.DOCKER_USER_IOB }} --password ${{ secrets.DOCKER_PASS_IOB }} push from-spec manifest_majorversion_iob.yaml
sed -e "s/\${VERSION}/${{ env.version }}/g" -e "s/\${DOCKERTAG}/${{ env.version }}/g" ./manifest_iob.yml > manifest_version_iob.yaml
./manifest-tool --username ${{ secrets.DOCKER_USER_IOB }} --password ${{ secrets.DOCKER_PASS_IOB }} push from-spec manifest_version_iob.yaml
19 changes: 19 additions & 0 deletions manifest_iob.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
image: iobroker/iobroker:${DOCKERTAG}
manifests:
-
image: iobroker/iobroker:${VERSION}-amd64
platform:
architecture: amd64
os: linux
-
image: iobroker/iobroker:${VERSION}-arm64v8
platform:
architecture: arm64
variant: v8
os: linux
-
image: iobroker/iobroker:${VERSION}-arm32v7
platform:
architecture: arm
variant: v7
os: linux

0 comments on commit edd9c5e

Please sign in to comment.