Compare commits
7 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
383af5a61e
|
|||
|
67593cc678
|
|||
|
4570d10238
|
|||
|
c05cd29028
|
|||
|
a62a960ebd
|
|||
|
23a6d9d18e
|
|||
|
30a7c3194d
|
@@ -1,65 +0,0 @@
|
|||||||
name: Build and Push Docker Image
|
|
||||||
|
|
||||||
on:
|
|
||||||
push:
|
|
||||||
branches:
|
|
||||||
- "release/*"
|
|
||||||
tags:
|
|
||||||
- "*"
|
|
||||||
workflow_dispatch:
|
|
||||||
|
|
||||||
jobs:
|
|
||||||
docker:
|
|
||||||
runs-on: ubuntu-latest
|
|
||||||
if: ${{ !contains(github.event.head_commit.message, '[skip ci]') }}
|
|
||||||
steps:
|
|
||||||
- name: Checkout
|
|
||||||
uses: actions/checkout@v4
|
|
||||||
with:
|
|
||||||
# Ensure full history and all tags are available
|
|
||||||
fetch-depth: 0
|
|
||||||
|
|
||||||
- name: Set up QEMU (multi-arch)
|
|
||||||
uses: docker/setup-qemu-action@v3
|
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
|
||||||
uses: docker/setup-buildx-action@v3
|
|
||||||
|
|
||||||
- name: Docker meta
|
|
||||||
id: meta
|
|
||||||
uses: docker/metadata-action@v5
|
|
||||||
with:
|
|
||||||
images: gitea.suda.codes/${{ github.repository }}
|
|
||||||
tags: |
|
|
||||||
type=ref,event=tag
|
|
||||||
|
|
||||||
- name: Determine latest Git tag
|
|
||||||
id: latest
|
|
||||||
shell: bash
|
|
||||||
run: |
|
|
||||||
set -euo pipefail
|
|
||||||
# Fetch tags in case the runner's mirror is stale
|
|
||||||
git fetch --tags --force --quiet || true
|
|
||||||
if tag=$(git describe --tags --abbrev=0 2>/dev/null); then
|
|
||||||
echo "tag=$tag" >> "$GITHUB_OUTPUT"
|
|
||||||
else
|
|
||||||
# Fallback when no tags exist
|
|
||||||
echo "tag=latest" >> "$GITHUB_OUTPUT"
|
|
||||||
fi
|
|
||||||
|
|
||||||
- name: Log in to container registry
|
|
||||||
uses: docker/login-action@v3
|
|
||||||
with:
|
|
||||||
registry: gitea.suda.codes
|
|
||||||
username: ${{ secrets.REGISTRY_USERNAME }}
|
|
||||||
password: ${{ secrets.REGISTRY_PASSWORD }}
|
|
||||||
|
|
||||||
- name: Build and push
|
|
||||||
uses: docker/build-push-action@v6
|
|
||||||
with:
|
|
||||||
context: .
|
|
||||||
push: true
|
|
||||||
# Always tag with the latest Git tag; also keep any tags from metadata (e.g., on tag events)
|
|
||||||
tags: |
|
|
||||||
${{ steps.meta.outputs.tags }}
|
|
||||||
gitea.suda.codes/${{ github.repository }}:${{ steps.latest.outputs.tag }}
|
|
||||||
@@ -11,9 +11,9 @@ RUN pip install --no-cache-dir --upgrade torch torchvision mokuro
|
|||||||
|
|
||||||
# create a user to run the application
|
# create a user to run the application
|
||||||
RUN useradd -m mokurouser \
|
RUN useradd -m mokurouser \
|
||||||
&& mkdir -p /home/mokurouser/mokuro \
|
&& mkdir -p /mokuro \
|
||||||
&& chown -R mokurouser:mokurouser /home/mokurouser
|
&& chown -R mokurouser:mokurouser /mokuro
|
||||||
|
|
||||||
WORKDIR /home/mokurouser/mokuro
|
WORKDIR /mokuro
|
||||||
|
|
||||||
COPY . .
|
COPY . .
|
||||||
|
|||||||
@@ -8,11 +8,12 @@ services:
|
|||||||
container_name: mokuro
|
container_name: mokuro
|
||||||
user: 1000:1000
|
user: 1000:1000
|
||||||
volumes:
|
volumes:
|
||||||
- ~/S/japanese/manga/One Piece Color/One Piece color v06-10:/home/mokurouser/mokuro
|
- ~/S/japanese/manga:/mokuro/manga
|
||||||
command: mokuro --parent_dir One\ Piece\ Color --disable_confirmation
|
command: ./run.sh "manga/One Piece Color"
|
||||||
runtime: nvidia
|
runtime: nvidia
|
||||||
restart: no
|
restart: no
|
||||||
network_mode: host
|
network_mode: host
|
||||||
|
tty: true
|
||||||
deploy:
|
deploy:
|
||||||
resources:
|
resources:
|
||||||
reservations:
|
reservations:
|
||||||
|
|||||||
25
run.sh
Executable file
25
run.sh
Executable file
@@ -0,0 +1,25 @@
|
|||||||
|
#!/usr/bin/env sh
|
||||||
|
set -Eeuo pipefail
|
||||||
|
|
||||||
|
DIR="${1:-.}"
|
||||||
|
|
||||||
|
mokuro --parent_dir "$DIR" --disable_confirmation
|
||||||
|
|
||||||
|
cd "$DIR" || exit
|
||||||
|
|
||||||
|
for f in *.mokuro; do
|
||||||
|
[ -e "$f" ] || continue # skip if no .mokuro files
|
||||||
|
base="${f%.mokuro}"
|
||||||
|
dir="$base"
|
||||||
|
zipfile="$base.zip"
|
||||||
|
if [ -f "$zipfile" ]; then
|
||||||
|
echo "Warning: Zip file $zipfile already exists, skipping."
|
||||||
|
elif [ -d "$dir" ]; then
|
||||||
|
echo "Zipping: $zipfile <- $f $dir/"
|
||||||
|
zip -qr "$zipfile" "$f" "$dir"
|
||||||
|
else
|
||||||
|
echo "Warning: Directory '$dir' not found for '$f', skipping."
|
||||||
|
fi
|
||||||
|
done
|
||||||
|
|
||||||
|
rm -rf ./*.html
|
||||||
Reference in New Issue
Block a user