diff --git a/.gitlab-ci.yml b/.gitlab-ci.yml index 064613a..e8c7eaa 100644 --- a/.gitlab-ci.yml +++ b/.gitlab-ci.yml @@ -36,3 +36,19 @@ deploy_to_pypi: - pyproject.toml script: - POETRY_PYPI_TOKEN_PYPI=$PYPI_PASSWORD poetry publish --build + +deploy_to_dockerhub: + stage: deploy + only: + refs: + - master + changes: + - Dockerfile + image: docker:latest + services: + - docker:dind + before_script: + - docker login -u $DOCKERHUB_USERNAME -p $DOCKERHUB_PASSWORD + - docker buildx create --use + script: + - docker buildx build --push --tag roger/subscleaner:latest . diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..44aaa8b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,8 @@ +FROM python:alpine + +RUN apk update && apk add --no-cache curl gcc g++ make libxml2-dev libxslt-dev tzdata && \ + pip install --no-cache-dir subscleaner + +RUN echo -e "SHELL=/bin/sh\nPATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin\n\n" > /etc/crontabs/root + +CMD echo "$CRON find /files -name \"*.srt\" | $(which subscleaner)" >> /etc/crontabs/root && crond -f