diff --git a/.drone.yml b/.drone.yml index bb8bee7..dc7d8bc 100644 --- a/.drone.yml +++ b/.drone.yml @@ -1,24 +1,22 @@ --- kind: pipeline type: docker -name: build-app +name: publish-bot -steps: -- name: build-dotnet - image: mcr.microsoft.com/dotnet/sdk:6.0 - commands: - - dotnet build - -steps: -- name: build-docker - image: docker:dind - volumes: - - name: dockersock - path: /var/run/docker.sock +- name: build-image + image: plugins/docker + settings: + registry: git.kizaing.ca + username: + from_secret: DOCKER_USER + password: + from_secret: DOCKER_PASS + repo: git.kizaing.ca/kizaing/TeleTok + tags: latest # Commented out until stuff actually works -#trigger: -# branch: -# - main -# event: -# - push \ No newline at end of file +trigger: + branch: + - main + event: + - push \ No newline at end of file diff --git a/Dockerfile b/Dockerfile index 9afbfcd..c2f75c4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,11 +1,14 @@ +#Builds the bot from source +FROM mcr.microsoft.com/dotnet/sdk:6.0 AS build-task + +COPY . /build +RUN cd /build && dotnet publish + +# Actually runs the bot FROM mcr.microsoft.com/dotnet/runtime:6.0-alpine3 WORKDIR /app/teletok -RUN apk update && apk add --update nodejs nodejs-npm - -RUN npm i -g tiktok-scraper - -COPY bin/Debug/net6.0/* /app/teletok/ +COPY --from=build-task /build/bin/Debug/net6.0/publish/* /app/teletok/ CMD [ "TeleTok" ] \ No newline at end of file