chore: docker multi-arch build

This commit is contained in:
langhuihui
2025-05-19 14:36:02 +08:00
parent 4db5d8fc9f
commit 7a7e461f77
3 changed files with 25 additions and 16 deletions

View File

@@ -83,7 +83,6 @@ jobs:
- name: docker build amd64
if: success() && startsWith(github.ref, 'refs/tags/')
run: |
rm -f m7s monibuca_linux admin.zip
curl -L https://download.m7s.live/bin/admin.zip -o admin.zip
tar -zxvf bin/m7s_v5_linux_amd64.tar.gz
mv m7s monibuca_linux
@@ -92,19 +91,12 @@ jobs:
- name: docker build arm64
if: success() && startsWith(github.ref, 'refs/tags/')
run: |
rm -f m7s monibuca_linux admin.zip
curl -L https://download.m7s.live/bin/admin.zip -o admin.zip
tar -zxvf bin/m7s_v5_linux_arm64.tar.gz
mv m7s monibuca_linux
mv -f m7s monibuca_linux
docker login -u langhuihui -p ${{ secrets.DOCKER_PASSWORD }}
docker buildx build --platform linux/arm64 -t langhuihui/monibuca:v5-arm64 --push .
- name: docker push amd64 version tag
docker buildx build --platform linux/arm64 -t langhuihui/monibuca:v5 --push .
- name: docker push version tag
if: success() && !contains(env.version, 'beta')
run: |
docker tag langhuihui/monibuca:v5 langhuihui/monibuca:${{ env.version }}
docker push langhuihui/monibuca:${{ env.version }}
- name: docker push arm64 version tag
if: success() && !contains(env.version, 'beta')
run: |
docker tag langhuihui/monibuca:v5-arm64 langhuihui/monibuca:${{ env.version }}-arm64
docker push langhuihui/monibuca:${{ env.version }}-arm64
docker push langhuihui/monibuca:${{ env.version }}

View File

@@ -1,14 +1,13 @@
# Running Stage
FROM alpine:3.20
FROM linuxserver/ffmpeg:latest
WORKDIR /monibuca
# Install ffmpeg
RUN apk add --no-cache ffmpeg
# Copy the pre-compiled binary from the build context
# The GitHub Actions workflow prepares 'monibuca_linux' in the context root
COPY monibuca_linux ./monibuca_linux
COPY admin.zip ./admin.zip
# Copy the configuration file from the build context

18
scripts/retag.sh Normal file
View File

@@ -0,0 +1,18 @@
#!/bin/sh
# 获取最新的 tag
LATEST_TAG=$(git describe --tags --abbrev=0)
if [ -z "$LATEST_TAG" ]; then
echo "没有找到任何 tag."
exit 1
fi
echo "最新的 tag 是: $LATEST_TAG"
# 删除 tag
git tag -d $LATEST_TAG
git push --delete origin $LATEST_TAG
git tag $LATEST_TAG
git push --tag