Skip to content

Commit cbbbab7

Browse files
committed
Add node image build and compose file
1 parent 1252588 commit cbbbab7

2 files changed

Lines changed: 139 additions & 0 deletions

File tree

.github/workflows/docker-image.yml

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -67,6 +67,61 @@ jobs:
6767
if-no-files-found: error
6868
retention-days: 1
6969

70+
build-node:
71+
runs-on: ${{ matrix.runner }}
72+
strategy:
73+
matrix:
74+
include:
75+
- runner: ubuntu-latest
76+
platform: linux/amd64
77+
- runner: ubuntu-24.04-arm
78+
platform: linux/arm64
79+
steps:
80+
- name: Checkout
81+
uses: actions/checkout@v4
82+
83+
- name: Set up Docker Buildx
84+
uses: docker/setup-buildx-action@v3
85+
86+
- name: Login to Quay.io
87+
uses: docker/login-action@v3
88+
with:
89+
registry: quay.io
90+
username: ${{ secrets.QUAY_USERNAME }}
91+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
92+
93+
- name: Extract Docker metadata
94+
id: meta
95+
uses: docker/metadata-action@v5.5.1
96+
with:
97+
images: quay.io/ydrag0n/streambot
98+
99+
- name: Build and push by digest
100+
id: build
101+
uses: docker/build-push-action@v6
102+
with:
103+
context: .
104+
file: Dockerfile.node
105+
platforms: ${{ matrix.platform }}
106+
labels: ${{ steps.meta.outputs.labels }}
107+
outputs: type=image,name=quay.io/ydrag0n/streambot,push-by-digest=true,name-canonical=true,push=true
108+
cache-from: type=gha
109+
cache-to: type=gha,mode=max
110+
111+
- name: Export digest
112+
run: |
113+
mkdir -p /tmp/digests-node
114+
digest="${{ steps.build.outputs.digest }}"
115+
touch "/tmp/digests-node/${digest#sha256:}"
116+
117+
- name: Upload digest
118+
uses: actions/upload-artifact@v4
119+
with:
120+
name: digests-node-${{ matrix.platform == 'linux/amd64' && 'amd64' || 'arm64' }}
121+
path: /tmp/digests-node/*
122+
if-no-files-found: error
123+
retention-days: 1
124+
70125
merge:
71126
runs-on: ubuntu-latest
72127
needs:
@@ -101,4 +156,40 @@ jobs:
101156
docker buildx imagetools create \
102157
--tag quay.io/ydrag0n/streambot:latest \
103158
--tag quay.io/ydrag0n/streambot:${{ github.ref_name }} \
159+
$(printf 'quay.io/ydrag0n/streambot@sha256:%s ' *)
160+
161+
merge-node:
162+
runs-on: ubuntu-latest
163+
needs:
164+
- build-node
165+
steps:
166+
- name: Download digests
167+
uses: actions/download-artifact@v4
168+
with:
169+
path: /tmp/digests-node
170+
pattern: digests-node-*
171+
merge-multiple: true
172+
173+
- name: Set up Docker Buildx
174+
uses: docker/setup-buildx-action@v3
175+
176+
- name: Login to Quay.io
177+
uses: docker/login-action@v3
178+
with:
179+
registry: quay.io
180+
username: ${{ secrets.QUAY_USERNAME }}
181+
password: ${{ secrets.QUAY_ROBOT_TOKEN }}
182+
183+
- name: Extract Docker metadata
184+
id: meta
185+
uses: docker/metadata-action@v5.5.1
186+
with:
187+
images: quay.io/ydrag0n/streambot
188+
189+
- name: Create manifest list and push
190+
working-directory: /tmp/digests-node
191+
run: |
192+
docker buildx imagetools create \
193+
--tag quay.io/ydrag0n/streambot:node \
194+
--tag quay.io/ydrag0n/streambot:node-${{ github.ref_name }} \
104195
$(printf 'quay.io/ydrag0n/streambot@sha256:%s ' *)

docker-compose-node.yml

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
services:
2+
streambot:
3+
image: quay.io/ydrag0n/streambot:node
4+
container_name: streambot
5+
restart: always
6+
environment:
7+
# Selfbot options
8+
TOKEN: "" # Your Discord self-bot token
9+
PREFIX: "$" # The prefix used to trigger your self-bot commands
10+
GUILD_ID: "" # The ID of the Discord server your self-bot will be running on
11+
COMMAND_CHANNEL_ID: "" # The ID of the Discord channel where your self-bot will respond to commands
12+
VIDEO_CHANNEL_ID: "" # The ID of the Discord voice/video channel where your self-bot will stream videos
13+
ADMIN_IDS: '["YOUR_USER_ID_HERE"]' # A list of Discord user IDs that are considered administrators (comma-separated or JSON array format)
14+
# General options
15+
VIDEOS_DIR: "./videos" # The local path where you store video files
16+
PREVIEW_CACHE_DIR: "./tmp/preview-cache" # The local path where your self-bot will cache video preview thumbnails
17+
18+
# yt-dlp options
19+
YTDLP_COOKIES_PATH: "" # Path to cookies file for yt-dlp (for accessing age-restricted or premium content)
20+
21+
# Stream options
22+
STREAM_RESPECT_VIDEO_PARAMS: "false" # This option is used to respect video parameters such as width, height, fps, bitrate, and max bitrate.
23+
STREAM_WIDTH: "1280" # The width of the video stream in pixels
24+
STREAM_HEIGHT: "720" # The height of the video stream in pixels
25+
STREAM_FPS: "30" # The frames per second (FPS) of the video stream
26+
STREAM_BITRATE_KBPS: "2000" # The bitrate of the video stream in kilobits per second (Kbps)
27+
STREAM_MAX_BITRATE_KBPS: "2500" # The maximum bitrate of the video stream in kilobits per second (Kbps)
28+
STREAM_HARDWARE_ACCELERATION: "false" # Whether to use hardware acceleration for video decoding, set to "true" to enable, "false" to disable
29+
STREAM_VIDEO_CODEC: "H264" # The video codec to use for the stream, can be "H264" or "H265" or "VP8"
30+
31+
# STREAM_H26X_PRESET: Determines the encoding preset for H26x video streams.
32+
# If the STREAM_H26X_PRESET environment variable is set, it parses the value
33+
# using the parsePreset function. If not set, it defaults to 'ultrafast' for
34+
# optimal encoding speed. This preset is only applicable when the codec is
35+
# H26x; otherwise, it should be disabled or ignored.
36+
# Available presets: "ultrafast", "superfast", "veryfast", "faster",
37+
# "fast", "medium", "slow", "slower", "veryslow".
38+
STREAM_H26X_PRESET: "ultrafast"
39+
40+
# Videos server options
41+
SERVER_ENABLED: "false" # Whether to enable the built-in video server
42+
SERVER_USERNAME: "admin" # The username for the video server's admin interface
43+
SERVER_PASSWORD: "admin" # The password for the video server's admin interface
44+
SERVER_PORT: "3000" # The port number the video server will listen on
45+
volumes:
46+
- ./videos:/home/bots/StreamBot/videos
47+
ports:
48+
- 3000:3000

0 commit comments

Comments
 (0)