feat(docker): update Docker configuration and add build workflow
This commit is contained in:
@@ -0,0 +1,54 @@
|
||||
name: Build and Push Docker Image
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- main
|
||||
- master
|
||||
tags:
|
||||
- "v*"
|
||||
workflow_dispatch:
|
||||
|
||||
env:
|
||||
GHCR_IMAGE: ghcr.io/mytheclipse/gmw
|
||||
|
||||
jobs:
|
||||
build-and-push:
|
||||
runs-on: ubuntu-latest
|
||||
permissions:
|
||||
contents: read
|
||||
packages: write
|
||||
|
||||
steps:
|
||||
- uses: actions/checkout@v6
|
||||
|
||||
- uses: docker/setup-buildx-action@v4
|
||||
|
||||
- name: Log in to GHCR
|
||||
uses: docker/login-action@v3
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: ${{ github.actor }}
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
|
||||
- name: Extract metadata
|
||||
id: meta
|
||||
uses: docker/metadata-action@v5
|
||||
with:
|
||||
images: ${{ env.GHCR_IMAGE }}
|
||||
tags: |
|
||||
type=raw,value=latest
|
||||
type=ref,event=tag
|
||||
type=sha,prefix=sha-
|
||||
|
||||
- name: Build and push
|
||||
uses: docker/build-push-action@v7
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
||||
cache-from: type=registry,ref=${{ env.GHCR_IMAGE }}:buildcache
|
||||
cache-to: type=registry,ref=${{ env.GHCR_IMAGE }}:buildcache,mode=max
|
||||
provenance: false
|
||||
sbom: false
|
||||
@@ -1,24 +0,0 @@
|
||||
name: Notify Parent Repo
|
||||
|
||||
on:
|
||||
push:
|
||||
branches:
|
||||
- master
|
||||
|
||||
jobs:
|
||||
dispatch:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- name: Trigger monorepo build
|
||||
uses: peter-evans/repository-dispatch@v3
|
||||
with:
|
||||
token: ${{ secrets.DISPATCH_TOKEN }}
|
||||
repository: MythEclipse/ultimate-asepharyana.tech
|
||||
event-type: submodule-updated
|
||||
client-payload: |
|
||||
{
|
||||
"service": "gmw",
|
||||
"ref": "${{ github.ref }}",
|
||||
"sha": "${{ github.sha }}",
|
||||
"actor": "${{ github.actor }}"
|
||||
}
|
||||
+35
@@ -0,0 +1,35 @@
|
||||
FROM node:22-bookworm-slim
|
||||
|
||||
# Runtime deps: ffmpeg for video muxing, yt-dlp for download, build tools for node-canvas
|
||||
RUN apt-get update && apt-get install -y --no-install-recommends \
|
||||
ffmpeg \
|
||||
python3 \
|
||||
curl \
|
||||
ca-certificates \
|
||||
git \
|
||||
make \
|
||||
g++ \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
# yt-dlp
|
||||
RUN curl -L https://github.com/yt-dlp/yt-dlp/releases/latest/download/yt-dlp \
|
||||
-o /usr/local/bin/yt-dlp && chmod a+rx /usr/local/bin/yt-dlp
|
||||
|
||||
RUN corepack enable
|
||||
|
||||
WORKDIR /app
|
||||
|
||||
# Install deps from the app-local build context.
|
||||
COPY package.json pnpm-lock.yaml pnpm-workspace.yaml* ./
|
||||
COPY vendor/discord-video-stream/package.json ./vendor/discord-video-stream/
|
||||
COPY vendor/discord.js-selfbot-v13/package.json ./vendor/discord.js-selfbot-v13/
|
||||
RUN pnpm install --no-frozen-lockfile
|
||||
|
||||
COPY . .
|
||||
|
||||
RUN pnpm run prepare:vendor
|
||||
RUN pnpm run build
|
||||
|
||||
ENV NODE_ENV=production
|
||||
|
||||
CMD ["pnpm", "run", "start"]
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
services:
|
||||
app:
|
||||
build: .
|
||||
image: ${IMAGE_NAME:-ghcr.io/mytheclipse/bete:latest}
|
||||
image: ${IMAGE_NAME:-ghcr.io/mytheclipse/gmw:latest}
|
||||
container_name: imphenbot-app
|
||||
restart: unless-stopped
|
||||
env_file:
|
||||
|
||||
Reference in New Issue
Block a user