mirror of
https://github.com/mii443/ncb-tts-r2.git
synced 2025-08-22 16:15:29 +00:00
add Dockerfile
This commit is contained in:
31
.github/workflows/build.yml
vendored
31
.github/workflows/build.yml
vendored
@ -1,12 +1,29 @@
|
||||
on: [push]
|
||||
|
||||
on:
|
||||
push:
|
||||
branches-ignore:
|
||||
- '**'
|
||||
tags:
|
||||
- 'v*'
|
||||
jobs:
|
||||
build_and_test:
|
||||
name: Rust project
|
||||
build:
|
||||
runs-on: ubuntu-latest
|
||||
steps:
|
||||
- uses: actions/checkout@v2
|
||||
- uses: actions-rs/toolchain@v1
|
||||
- uses: docker/metadata-action@v3
|
||||
id: meta
|
||||
with:
|
||||
toolchain: stable
|
||||
- run: cargo build --release --all-features
|
||||
images: ghcr.io/morioka22/ncb-tts-r2
|
||||
tags: |
|
||||
type=semver,pattern={{version}}
|
||||
type=semver,pattern={{major}}.{{minor}}
|
||||
- uses: docker/login-action@v1
|
||||
with:
|
||||
registry: ghcr.io
|
||||
username: morioka22
|
||||
password: ${{ secrets.GITHUB_TOKEN }}
|
||||
- uses: docker/build-push-action@v2
|
||||
with:
|
||||
context: .
|
||||
push: true
|
||||
tags: ${{ steps.meta.outputs.tags }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
16
Dockerfile
Normal file
16
Dockerfile
Normal file
@ -0,0 +1,16 @@
|
||||
FROM ubuntu:22.04
|
||||
RUN apt-get update \
|
||||
&& apt-get install -y ffmpeg libssl-dev pkg-config libopus-dev wget curl gcc \
|
||||
&& apt-get -y clean \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain stable
|
||||
ENV PATH $PATH:/root/.cargo/bin/
|
||||
RUN rustup install stable
|
||||
WORKDIR /usr/src/ncb-tts-r2
|
||||
COPY Cargo.toml .
|
||||
COPY src src
|
||||
RUN cargo build --release \
|
||||
&& cp /usr/src/ncb-tts-r2/target/release/ncb-tts-r2 /usr/bin/ncb-tts-r2 \
|
||||
&& mkdir -p /ncb-tts-r2/audio
|
||||
WORKDIR /ncb-tts-r2
|
||||
CMD ["ncb-tts-r2"]
|
Reference in New Issue
Block a user