Skip to content

Commit

Permalink
Init Project Files
Browse files Browse the repository at this point in the history
  • Loading branch information
wHyEt committed Jan 4, 2024
1 parent 98af924 commit 352f219
Show file tree
Hide file tree
Showing 4 changed files with 147 additions and 1 deletion.
104 changes: 104 additions & 0 deletions .github/main.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,104 @@
name: Workflow for Images

env:
DOCKERHUB_TAG: "whyet/BambuP1SCam"
DOCKERHUB_SHORT_DESCRIPTION: "Docker Container for Providing the Stream of the Camera from a Bambu P1S 3D Printer"
DOCKERHUB_README_FILE: "README.md"

on:
push:
branches:
- master


jobs:
main:
name: Build & Push Docker Images
runs-on: ubuntu-latest
strategy:
matrix:
include:
- arch: "amd64"
platform: "linux/amd64"
from: "debian:12"
- arch: "arm64"
platform: "linux/arm64"
from: "debian:12"
- arch: "armv7"
platform: "linux/arm/v7"
from: "debian:12"

steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up QEMU
uses: docker/setup-qemu-action@v1

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Build and push
uses: docker/build-push-action@v2
with:
context: .
file: ./Dockerfile
push: true
tags: ${{ env.DOCKERHUB_TAG }}:${{ matrix.arch }}-latest
build-args: CI_FROM=${{ matrix.from }}
platforms: ${{ matrix.platform }}

- name: Image digests
run: |
echo image digest: ${{ steps.docker_build.outputs.digest }}
manifest:
needs: main
name: Build & Push Multiarch Manifest
runs-on: ubuntu-latest
env:
DOCKER_CLI_EXPERIMENTAL: enabled
steps:
- name: Checkout
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Login to Docker Hub
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKER_HUB_USERNAME }}
password: ${{ secrets.DOCKER_HUB_PASSWORD }}

- name: Create Docker manifest
run: |
docker manifest create \
${{ env.DOCKERHUB_TAG }}:latest \
--amend ${{ env.DOCKERHUB_TAG }}:amd64-latest \
--amend ${{ env.DOCKERHUB_TAG }}:arm64-latest \
--amend ${{ env.DOCKERHUB_TAG }}:armv7-latest
- name: Push manifest to Docker Hub
run: |
docker manifest push ${{ env.DOCKERHUB_TAG }}:latest
pushreadme:
runs-on: ubuntu-latest
name: Push README to Docker Hub
steps:
- name: git checkout
uses: actions/checkout@v2
- name: push README to Dockerhub
uses: christian-korneck/update-container-description-action@v1
env:
DOCKER_USER: ${{ secrets.DOCKER_HUB_USERNAME }}
DOCKER_PASS: ${{ secrets.DOCKER_HUB_PASSWORD }}
with:
destination_container_repo: ${{ env.DOCKERHUB_TAG }}
provider: dockerhub
short_description: ${{ env.DOCKERHUB_SHORT_DESCRIPTION }}
readme_file: ${{ env.DOCKERHUB_README_FILE }}
21 changes: 21 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# Arch will be changed while building from GitHub Actions CI Workflow
# debian:12


ARG CI_FROM=null
FROM ${CI_FROM}
RUN echo "Set FROM to $CI_FROM"

# Output target platform
ARG TARGETPLATFORM
RUN echo "Building for ARCH $TARGETPLATFORM"


WORKDIR /data
EXPOSE 1984 1984


# Set entrypoint
COPY ./assets/entrypoint.sh /entrypoint.sh
RUN chmod +x /entrypoint.sh
ENTRYPOINT [ "/entrypoint.sh" ]
8 changes: 7 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,8 @@
# BambuP1SCam
Docker Container for Providing the Stream of the Camera froma Bambu P1S 3D Printer
Docker Container for Providing the Stream of the Camera from a Bambu P1S 3D Printer

# Just starting to BUild this container is still work in progress

# Please Support my Work, thank you :)

<a href="https://www.buymeacoffee.com/TechNic" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" style="height: 20px !important;width: 155px !important;" ></a>
15 changes: 15 additions & 0 deletions assets/entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
#!/bin/sh

set -e

3DPrinter_IP=${3DPrinter_IP}
3DPrinter_CODE=${3DPrinter_CODE}

mkdir work
cd work

wget https://public-cdn.bambulab.com/upgrade/studio/plugins/01.04.00.15/linux_01.04.00.15.zip
unzip linux_01.04.00.15.zip

wget https://github.com/AlexxIT/go2rtc/releases/download/v1.6.2/go2rtc_linux_amd64
chmod a+x go2rtc_linux_amd64

0 comments on commit 352f219

Please sign in to comment.