diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..c45bd82 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,34 @@ +name: "Build and Push Image" + +on: + push: + tags: + - '*' + +jobs: + build-and-push: + runs-on: ubuntu-latest + + steps: + - name: Checkou code + uses: actions/checkout@v4 + + - name: Set up Docker Build + uses: docker/setup-buildx-action@v3 + + - name: Login + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USER }} + password: ${{ secrets.DOCKER_PASS }} + + - name: Extract tag version + id: extract_tag + run: echo "VERSION=${GITHUB_REF#refs/tags/}" >> $GITHUB_ENV + + - name: Build and Push + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: git.kaisei.app/amatsugu/aoba:${{ env.VERSION }} diff --git a/AobaServer/Dockerfile b/AobaServer/Dockerfile index 68ad00e..c48d222 100644 --- a/AobaServer/Dockerfile +++ b/AobaServer/Dockerfile @@ -18,7 +18,7 @@ COPY /AobaServer/Proto /app/AobaServer/Proto # Install Protobuf RUN apt update -RUN apt install -y protobuf-compiler libprotobuf-dev +RUN apt install -y protobuf-compiler libprotobuf-dev ffmpeg # Install `dx` RUN curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash @@ -57,6 +57,6 @@ RUN dotnet publish "./AobaServer.csproj" -c $BUILD_CONFIGURATION -o /app/publish FROM base AS final WORKDIR /app COPY --from=publish /app/publish . -# RUN apt update -# RUN apt install -y ffmpeg libgdiplus +COPY --from=client-builder /bin/ffmpeg /bin/ffprobe /bin/ffplay /usr/bin/ + ENTRYPOINT ["dotnet", "AobaServer.dll"] diff --git a/publish.nu b/publish.nu new file mode 100644 index 0000000..ff96b6d --- /dev/null +++ b/publish.nu @@ -0,0 +1,3 @@ +def publish (tag: string) { + docker build -f AobaServer/Dockerfile -t git.kaisei.app/amatsugu/aoba:($tag) .; docker push git.kaisei.app/amatsugu/aoba:($tag) +}