-
Notifications
You must be signed in to change notification settings - Fork 863
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
94 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
name: xiaoya glue | ||
|
||
on: | ||
workflow_dispatch: | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-latest | ||
name: Build Docker Image | ||
steps: | ||
- | ||
name: Checkout | ||
uses: actions/checkout@v4 | ||
|
||
- name: Docker meta | ||
id: meta | ||
uses: docker/metadata-action@v5 | ||
with: | ||
images: ${{ secrets.DOCKER_USERNAME }}/xiaoya-glue | ||
|
||
- | ||
name: Set Up QEMU | ||
uses: docker/setup-qemu-action@v3 | ||
|
||
- | ||
name: Set Up Buildx | ||
uses: docker/setup-buildx-action@v3 | ||
|
||
- | ||
name: Login DockerHub | ||
uses: docker/login-action@v3 | ||
with: | ||
username: ${{ secrets.DOCKER_USERNAME }} | ||
password: ${{ secrets.DOCKER_PASSWORD }} | ||
|
||
- | ||
name: Build Image | ||
uses: docker/build-push-action@v5 | ||
with: | ||
context: . | ||
file: Dockerfile | ||
platforms: | | ||
linux/amd64 | ||
linux/arm64/v8 | ||
push: true | ||
tags: | | ||
${{ secrets.DOCKER_USERNAME }}/xiaoya-glue:latest | ||
labels: ${{ steps.meta.outputs.labels }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,16 @@ | ||
FROM ubuntu:22.04 | ||
|
||
RUN set -ex && \ | ||
apt update -y && \ | ||
apt install -y \ | ||
busybox \ | ||
unzip \ | ||
curl \ | ||
fd-find \ | ||
gzip \ | ||
wget \ | ||
lsof \ | ||
tzdata && \ | ||
rm -rf /tmp/* /var/lib/apt/lists/* | ||
|
||
COPY --chmod=755 docker_address.sh /docker_address.sh |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
#!/bin/bash | ||
|
||
Green="\033[32m" | ||
Red="\033[31m" | ||
Yellow='\033[33m' | ||
Font="\033[0m" | ||
INFO="[${Green}INFO${Font}]" | ||
ERROR="[${Red}ERROR${Font}]" | ||
WARN="[${Yellow}WARN${Font}]" | ||
function INFO() { | ||
echo -e "${INFO} ${1}" | ||
} | ||
function ERROR() { | ||
echo -e "${ERROR} ${1}" | ||
} | ||
function WARN() { | ||
echo -e "${WARN} ${1}" | ||
} | ||
|
||
cd /meida/xiaoya | ||
|
||
INFO "执行替换DOCKER_ADDRESS............" | ||
start_time2=`date +%s` | ||
find ./ -name "*.strm" -exec sed \-i "s#DOCKER_ADDRESS#$docker_addr#g; s# #%20#g; s#|#%7C#g" {} \; | ||
fdfind --extension strm --exec sed \-i "s#DOCKER_ADDRESS#$docker_addr#g; s# #%20#g; s#|#%7C#g" {} \; | ||
chmod -R 777 * | ||
end_time2=`date +%s` | ||
total_time2=$((end_time2 - start_time2)) | ||
total_time2=$((total_time2 / 60)) | ||
INFO "替换执行时间:$total_time2 分钟" |