Skip to content

Jellyfin Image Update #201

Jellyfin Image Update

Jellyfin Image Update #201

name: Jellyfin Docker Image Publish
on:
workflow_dispatch:
inputs:
JELLYFIN_VERSION:
required: false
type: string
description: 'The server and web stable version ("X.Y.Z")'
# DOTNET_VERSION:
# required: false
# type: string
# description: 'The dotnet stable version ("X.Y")'
FFMPEG_VERSION:
required: false
type: string
description: 'The ffmpeg stable version ("X.Y.Z-V")'
repository_dispatch:
jobs:
Jellyfin_Publish:
runs-on: ubuntu-latest
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Get latest versions
id: getVersion
run: |
if [ -z ${{ inputs.JELLYFIN_VERSION }} ]; then
JELLYFIN_VERSION=$(wget -qO- -t1 -T2 https://api.github.com/repos/jellyfin/jellyfin/releases/latest | grep '"name"' | awk -F "\"" '{printf $4}')
else
JELLYFIN_VERSION=${{ inputs.JELLYFIN_VERSION }}
fi
echo "jellyfinVersion=$JELLYFIN_VERSION" >> $GITHUB_OUTPUT
# if [ -z ${{ inputs.DOTNET_VERSION }} ]; then
# DOTNET_VERSION=$(wget -qO- -t1 -T2 https://dotnet.microsoft.com/zh-cn/download | grep 'md:version' | awk 'NR==1' | awk '{printf $9}' | awk -F "<" '{printf $1}')
# else
# DOTNET_VERSION=${{ inputs.DOTNET_VERSION }}
# fi
# echo "dotnetVersion=$DOTNET_VERSION" >> $GITHUB_OUTPUT
if [ -z ${{ inputs.FFMPEG_VERSION }} ]; then
FFMPEG_VERSION=$(wget -qO- -t1 -T2 https://api.github.com/repos/jellyfin/jellyfin-ffmpeg/releases/latest | grep '"name"' | awk '{printf $3}' | awk -F "\"" '{printf $1}')
else
FFMPEG_VERSION=${{ inputs.FFMPEG_VERSION }}
fi
echo "ffmpegVersion=$FFMPEG_VERSION" >> $GITHUB_OUTPUT
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_HUB_USER }}
password: ${{ secrets.DOCKER_HUB_TOKEN }}
- name: Login to AliYun Registry
uses: docker/login-action@v3
with:
registry: registry.cn-chengdu.aliyuncs.com
username: ${{ secrets.ALIYUN_USER }}
password: ${{ secrets.ALIYUN_TOKEN }}
- name: Build and Push Docker images
id: build
uses: docker/build-push-action@v5
with:
file: Dockerfile
context: .
push: true
build-args: |
# DOTNET_VERSION=${{ steps.getVersion.outputs.dotnetVersion }}
FFMPEG_VERSION=${{ steps.getVersion.outputs.ffmpegVersion }}
JELLYFIN_VERSION=${{ steps.getVersion.outputs.jellyfinVersion }}
tags: |
clion007/jellyfin:latest
clion007/jellyfin:${{ steps.getVersion.outputs.jellyfinVersion }}
registry.cn-chengdu.aliyuncs.com/clion/jellyfin:latest
registry.cn-chengdu.aliyuncs.com/clion/jellyfin:${{ steps.getVersion.outputs.jellyfinVersion }}
- name: Get Release Body
id: getBody
if: steps.build.outcome == 'success'
run: |
# CHANGES=$(curl -fsSL https://github.com/jellyfin/jellyfin/releases/latest | grep "<li>" | sed '/<li>$/d')
# BODYINFO="<h3>Changes</h3><ul>${CHANGES}</ul>"
BODYINFO="Changes for details can view in offical link https://github.com/jellyfin/jellyfin/releases/latest"
# echo "BodyInfo<<EOF" >> $GITHUB_OUTPUT
# echo "$BODYINFO" >> $GITHUB_OUTPUT
# echo "EOF" >> $GITHUB_OUTPUT
echo "BodyInfo=$BODYINFO" >> $GITHUB_OUTPUT
- name: Publish Release
if: steps.build.outcome == 'success'
uses: ncipollo/release-action@v1
with:
name: Jellyfin Server v${{ steps.getVersion.outputs.jellyfinVersion }}
tag: v${{ steps.getVersion.outputs.jellyfinVersion }}
body: ${{ steps.getBody.outputs.BodyInfo }}
skipIfReleaseExists: true
- name: Delete workflow runs
uses: Mattraks/delete-workflow-runs@v2
with:
retain_days: 0
keep_minimum_runs: 2