diff --git a/.github/workflows/build-container-image.yml b/.github/workflows/build-container-image.yml new file mode 100644 index 0000000..fba5d70 --- /dev/null +++ b/.github/workflows/build-container-image.yml @@ -0,0 +1,50 @@ +name: Build container image +on: + push: + workflow_dispatch: + +env: + IMAGE_NAME: ultrasinger + IMAGE_TAGS: v1 ${{ github.sha }} + IMAGE_REGISTRY: ghcr.io/${{ github.repository_owner }} + REGISTRY_USER: ${{ github.actor }} + REGISTRY_PASSWORD: ${{ github.token }} + +jobs: + push-ghcr: + name: Build and push image + runs-on: ubuntu-22.04 + + steps: + # Checkout push-to-registry action github repository + - name: Checkout Push to Registry action + uses: actions/checkout@v4 + + # Build image using Buildah action + - name: Build Image + id: build_image + uses: redhat-actions/buildah-build@v2 + with: + image: ${{ env.IMAGE_NAME }} + tags: ${{ env.IMAGE_TAGS }} + containerfiles: | + ./Dockerfile + oci: true + layers: true + + # Push the image to GHCR (Image Registry) + - name: Push To GHCR + uses: ./ + id: push + with: + image: ${{ steps.build_image.outputs.image }} + tags: ${{ steps.build_image.outputs.tags }} + registry: ${{ env.IMAGE_REGISTRY }} + username: ${{ env.REGISTRY_USER }} + password: ${{ env.REGISTRY_PASSWORD }} + extra-args: | + --disable-content-trust + + - name: Echo outputs + run: | + echo "${{ toJSON(steps.push.outputs) }}" \ No newline at end of file diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml deleted file mode 100644 index a5a54cd..0000000 --- a/.github/workflows/docker.yml +++ /dev/null @@ -1,28 +0,0 @@ -name: docker - -on: - push: - branches: - - 'main' - -jobs: - docker: - environment: docker - runs-on: ubuntu-latest - steps: - - name: Delete huge unnecessary tools folder - run: rm -rf /opt/hostedtoolcache - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 - - name: Login to Docker Hub - uses: docker/login-action@v3 - with: - username: ${{ secrets.DOCKERHUB_USERNAME }} - password: ${{ secrets.DOCKERHUB_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v6 - with: - push: true - tags: rakuri255/ultrasinger:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index ed33e07..0937081 100644 --- a/Dockerfile +++ b/Dockerfile @@ -6,7 +6,7 @@ RUN apt-get update \ && apt-get clean \ && rm -rf /var/lib/apt/lists/* -COPY . /app/UltraSinger +COPY ./requirements.txt /app/UltraSinger/requirements.txt WORKDIR /app/UltraSinger # no need to run as root @@ -23,5 +23,6 @@ RUN pip install --no-cache-dir -r requirements.txt \ && pip install --no-cache-dir torch==2.3.0 torchvision==0.18.0 torchaudio==2.3.0 --index-url https://download.pytorch.org/whl/cu121 \ && pip install --no-cache-dir tensorflow[and-cuda]==2.16.1 +COPY . /app/UltraSinger WORKDIR /app/UltraSinger/src CMD ["bash" ]