Skip to content

Commit

Permalink
feat: xiaoya glue
Browse files Browse the repository at this point in the history
  • Loading branch information
DDSRem committed Jan 6, 2024
1 parent 31ae30b commit c2d341a
Show file tree
Hide file tree
Showing 3 changed files with 94 additions and 0 deletions.
48 changes: 48 additions & 0 deletions .github/workflows/build.yml
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 }}
16 changes: 16 additions & 0 deletions Dockerfile
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
30 changes: 30 additions & 0 deletions docker_address.sh
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 分钟"

0 comments on commit c2d341a

Please sign in to comment.