Skip to content

Commit

Permalink
Merge pull request #75 from monlor/test
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor authored Jun 7, 2024
2 parents 8d8a5f9 + 1be36d5 commit e20d5b5
Show file tree
Hide file tree
Showing 10 changed files with 89 additions and 45 deletions.
82 changes: 67 additions & 15 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,12 +18,19 @@ concurrency:
jobs:
prepare:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
# This is used to complete the identity challenge
# with sigstore/fulcio when running outside of PRs.
id-token: write
outputs:
alist_tags: ${{ steps.vars.outputs.alist_tags }}
metadata_tags: ${{ steps.vars.outputs.metadata_tags }}
embyserver_tags: ${{ steps.vars.outputs.embyserver_tags }}
embyhack_tags: ${{ steps.vars.outputs.embyhack_tags }}
embyserver-amilys_tags: ${{ steps.vars.outputs.embyserver-amilys_tags }}
jellyfin_tags: ${{ steps.vars.outputs.jellyfin_tags }}
jellyfin-nyanmisaka_tags: ${{ steps.vars.outputs.jellyfin-nyanmisaka_tags }}
steps:
- name: Checkout code
uses: actions/checkout@v3
Expand All @@ -32,21 +39,52 @@ jobs:
id: vars
run: |
IMAGE_PREFIX="ghcr.io/${{ github.repository_owner }}"
vars=(
"alist"
"metadata"
"embyserver"
"embyserver-amilys"
"jellyfin"
"jellyfin-nyanmisaka"
)
if [[ $GITHUB_REF == refs/tags/* ]]; then
VERSION=${GITHUB_REF#refs/tags/}
echo "::set-output name=alist_tags::${IMAGE_PREFIX}/xiaoya-alist:latest,${IMAGE_PREFIX}/xiaoya-alist:${VERSION}"
echo "::set-output name=metadata_tags::${IMAGE_PREFIX}/xiaoya-metadata:latest,${IMAGE_PREFIX}/xiaoya-metadata:${VERSION}"
echo "::set-output name=embyserver_tags::${IMAGE_PREFIX}/xiaoya-embyserver:latest,${IMAGE_PREFIX}/xiaoya-embyserver:${VERSION}"
echo "::set-output name=embyhack_tags::${IMAGE_PREFIX}/xiaoya-embyhack:latest,${IMAGE_PREFIX}/xiaoya-embyhack:${VERSION}"
echo "::set-output name=jellyfin_tags::${IMAGE_PREFIX}/xiaoya-jellyfin:latest,${IMAGE_PREFIX}/xiaoya-jellyfin:${VERSION}"
for var in "${vars[@]}"; do
echo "::set-output name=${var}_tags::${IMAGE_PREFIX}/xiaoya-${var}:latest,${IMAGE_PREFIX}/xiaoya-${var}:${VERSION}"
done
else
LATEST_TAG=${GITHUB_REF#refs/heads/}
echo "::set-output name=alist_tags::${IMAGE_PREFIX}/xiaoya-alist:${LATEST_TAG}"
echo "::set-output name=metadata_tags::${IMAGE_PREFIX}/xiaoya-metadata:${LATEST_TAG}"
echo "::set-output name=embyserver_tags::${IMAGE_PREFIX}/xiaoya-embyserver:${LATEST_TAG}"
echo "::set-output name=embyhack_tags::${IMAGE_PREFIX}/xiaoya-embyhack:${LATEST_TAG}"
echo "::set-output name=jellyfin_tags::${IMAGE_PREFIX}/xiaoya-jellyfin:${LATEST_TAG}"
for var in "${vars[@]}"; do
echo "::set-output name=${var}_tags::${IMAGE_PREFIX}/xiaoya-${var}:${LATEST_TAG}"
done
fi
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Login to GitHub Container Registry
uses: docker/login-action@v2
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build base image
run: |
docker buildx imagetools create \
--tag ghcr.io/monlor/embyserver:latest \
amilys/embyserver:latest \
amilys/embyserver_arm64v8:latest
docker buildx imagetools create \
--tag ghcr.io/monlor/embyserver-amilys:latest \
amilys/embyserver:latest \
amilys/embyserver_arm64v8:latest
docker buildx imagetools create \
--tag ghcr.io/monlor/jellyfin-nyanmisaka:latest \
nyanmisaka/jellyfin:240401-amd64 \
nyanmisaka/jellyfin:240401-arm64
build-alist:
runs-on: ubuntu-latest
Expand Down Expand Up @@ -179,19 +217,19 @@ jobs:
tags: ${{ needs.prepare.outputs.embyserver_tags }}
platforms: linux/amd64,linux/arm64
build-args: |
BASE_IMAGE=embyserver
BASE_IMAGE=ghcr.io/monlor/embyserver:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Build and push xiaoya-embyhack
- name: Build and push xiaoya-embyserver-amilys
uses: docker/build-push-action@v4
with:
context: ./emby
push: true
tags: ${{ needs.prepare.outputs.embyhack_tags }}
tags: ${{ needs.prepare.outputs.embyserver-amilys_tags }}
platforms: linux/amd64,linux/arm64
build-args: |
BASE_IMAGE=embyhack
BASE_IMAGE=ghcr.io/monlor/embyserver-amilys:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

Expand Down Expand Up @@ -238,6 +276,20 @@ jobs:
push: true
tags: ${{ needs.prepare.outputs.jellyfin_tags }}
platforms: linux/amd64,linux/arm64
build-args: |
BASE_IMAGE=jellyfin/jellyfin:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

- name: Build and push xiaoya-jellyfin-nyanmisaka
uses: docker/build-push-action@v4
with:
context: ./jellyfin
push: true
tags: ${{ needs.prepare.outputs.jellyfin-nyanmisaka_tags }}
platforms: linux/amd64,linux/arm64
build-args: |
BASE_IMAGE=ghcr.io/monlor/jellyfin-nyanmisaka:latest
cache-from: type=local,src=/tmp/.buildx-cache
cache-to: type=local,dest=/tmp/.buildx-cache-new

Expand Down
4 changes: 2 additions & 2 deletions alist/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,9 +38,9 @@ docker run -d -p 5678:80 -p 2345:2345 -p 2346:2346 --restart=unless-stopped --na

`WEBDAV_PASSWORD`: webdav用户名为dav,设置密码。默认用户密码:guest/guest_Api789

`EMBY_ADDR`: emby部署地址,默认http://emby:6908
`EMBY_ADDR`: emby部署地址,默认http://emby:6908,容器内部使用地址,一般不用改

`JELLYFIN_ADDR`: jellyfin部署地址,默认http://jellyfin:8096
`JELLYFIN_ADDR`: jellyfin部署地址,默认http://jellyfin:8096,容器内部使用地址,一般不用改

`EMBY_APIKEY`: 填入一个emby的api key,用于在infuse中播放emby

Expand Down
1 change: 0 additions & 1 deletion emby/.dockerignore

This file was deleted.

4 changes: 2 additions & 2 deletions emby/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
ARG BASE_IMAGE=embyserver
ARG BASE_IMAGE=ghcr.io/monlor/embyserver:latest

FROM monlor/${BASE_IMAGE}:latest
FROM ${BASE_IMAGE}

LABEL MAINTAINER [email protected]

Expand Down
6 changes: 3 additions & 3 deletions emby/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,10 +5,10 @@

## 环境变量

`ALIST_ADDR`: 小雅alist的地址,默认http://alist:5678
`ALIST_ADDR`: 小雅alist的地址,默认http://alist:5678,容器内部使用地址,一般不用改

## 开心版镜像
## 其他镜像

```
ghcr.io/monlor/xiaoya-embyhack
ghcr.io/monlor/xiaoya-embyserver-amilys
```
17 changes: 0 additions & 17 deletions emby/create_embyserver.sh

This file was deleted.

6 changes: 4 additions & 2 deletions env
Original file line number Diff line number Diff line change
Expand Up @@ -20,9 +20,11 @@ FORCE_LOGIN=
# webdav用户名为dav,设置密码。默认用户密码:guest/guest_Api789
WEBDAV_PASSWORD=

# emby 地址
# emby 地址,容器内部使用地址,一般不用改
EMBY_ADDR=http://emby:6908
# alist 地址
# jellyfin 地址,容器内部使用地址,一般不用改
JELLYFIN_ADDR=http://jellyfin:8096
# alist 地址,容器内部使用地址,一般不用改
ALIST_ADDR=http://alist:5678

# 是否启用emby
Expand Down
4 changes: 3 additions & 1 deletion jellyfin/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
FROM jellyfin/jellyfin
ARG BASE_IMAGE=jellyfin/jellyfin:latest

FROM ${BASE_IMAGE}

LABEL MAINTAINER [email protected]

Expand Down
8 changes: 7 additions & 1 deletion jellyfin/README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
## 环境变量

`ALIST_ADDR`: 小雅alist的地址,默认http://alist:5678
`ALIST_ADDR`: 小雅alist的地址,默认http://alist:5678,容器内部使用地址,一般不用改

## 其他镜像

```
ghcr.io/monlor/xiaoya-jellyfin-nyanmisaka
```
2 changes: 1 addition & 1 deletion jellyfin/update_alist_addr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ if echo "${ALIST_DOMAIN}" | grep -E -q '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-
fi

while true; do
IP=$(nslookup "${ALIST_DOMAIN}" | awk '/^Address: / { print $2 }' | tail -n 1)
IP=$(ping -c 1 "${ALIST_DOMAIN}" | grep -Eo '\b([0-9]{1,3}\.){3}[0-9]{1,3}\b' | head -n 1)
if [ -n "$IP" ]; then
echo "Alist IP address: $IP"
add_hosts "$IP"
Expand Down

0 comments on commit e20d5b5

Please sign in to comment.