Skip to content

Commit

Permalink
ci: 🎡 优化镜像构建
Browse files Browse the repository at this point in the history
  • Loading branch information
monlor committed May 30, 2024
1 parent b195328 commit 813d088
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
13 changes: 13 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,9 @@ on:
- main
tags:
- '*'
paths-ignore:
- 'README.md'
- 'install.sh'

jobs:
build-and-push:
Expand Down Expand Up @@ -51,6 +54,8 @@ jobs:
ghcr.io/${{ github.repository_owner }}/xiaoya-alist:latest
${{ env.IS_TAG == 'true' && 'ghcr.io/${{ github.repository_owner }}/xiaoya-alist:${{ env.VERSION }}' || '' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push xiaoya-glue
uses: docker/build-push-action@v4
Expand All @@ -61,6 +66,8 @@ jobs:
ghcr.io/${{ github.repository_owner }}/xiaoya-glue:latest
${{ env.IS_TAG == 'true' && 'ghcr.io/${{ github.repository_owner }}/xiaoya-glue:${{ env.VERSION }}' || '' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push xiaoya-emby
uses: docker/build-push-action@v4
Expand All @@ -71,6 +78,8 @@ jobs:
ghcr.io/${{ github.repository_owner }}/xiaoya-emby:latest
${{ env.IS_TAG == 'true' && 'ghcr.io/${{ github.repository_owner }}/xiaoya-emby:${{ env.VERSION }}' || '' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push xiaoya-jellyfin
uses: docker/build-push-action@v4
Expand All @@ -81,6 +90,8 @@ jobs:
ghcr.io/${{ github.repository_owner }}/xiaoya-jellyfin:latest
${{ env.IS_TAG == 'true' && 'ghcr.io/${{ github.repository_owner }}/xiaoya-jellyfin:${{ env.VERSION }}' || '' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

- name: Build and push xiaoya-resilio
uses: docker/build-push-action@v4
Expand All @@ -91,4 +102,6 @@ jobs:
ghcr.io/${{ github.repository_owner }}/xiaoya-resilio:latest
${{ env.IS_TAG == 'true' && 'ghcr.io/${{ github.repository_owner }}/xiaoya-resilio:${{ env.VERSION }}' || '' }}
platforms: linux/amd64,linux/arm64
cache-from: type=gha
cache-to: type=gha,mode=max

6 changes: 6 additions & 0 deletions install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,12 @@ if ! command -v docker &> /dev/null; then
fi
fi

# 检查是否安装了compose插件,docker compose 命令
if ! docker compose &> /dev/null; then
echo "系统未安装docker compose插件,退出程序..."
exit 1
fi

# 检查服务是否已经运行
echo "检查服务是否已经运行..."
service_exist=0
Expand Down
2 changes: 1 addition & 1 deletion jellyfin/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ if echo "${ALIST_DOMAIN}" | grep -E -q '^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-
echo "Alist IP address: $IP"
else
# 使用 nslookup 解析 Alist 域名
IP=$(nslookup "${ALIST_DOMAIN:=alist}" | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -n 1)
IP=$(nslookup "${ALIST_DOMAIN}" | awk '/^Address: / { print $2 }' | tail -n 1)

# 检查 IP 地址是否解析成功
if [ -z "$IP" ]; then
Expand Down

0 comments on commit 813d088

Please sign in to comment.