diff --git a/.github/workflows/docker-push-image.yml b/.github/workflows/docker-push-image.yml new file mode 100644 index 0000000..d6f44f7 --- /dev/null +++ b/.github/workflows/docker-push-image.yml @@ -0,0 +1,28 @@ +name: Push OpenSIPS Python Images in Docker Hub + +on: + push: + repository_dispatch: + workflow_dispatch: + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v3 + + - name: Log in to Docker Hub + uses: docker/login-action@v2.1.0 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v4 + with: + context: . + push: true + tags: opensips/python-opensips:latest diff --git a/.github/workflows/docker-readme.yml b/.github/workflows/docker-readme.yml new file mode 100644 index 0000000..dad2ad1 --- /dev/null +++ b/.github/workflows/docker-readme.yml @@ -0,0 +1,26 @@ +--- +name: Update Docker Hub Description +on: + push: + branches: + - main + paths: + - docker/docker.md + - .github/workflows/docker-readme.yml + +jobs: + dockerHubDescription: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + + + - name: Docker Hub Description + uses: peter-evans/dockerhub-description@v4 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_TOKEN }} + repository: opensips/python-opensips + readme-filepath: ./docker/docker.md + short-description: ${{ github.event.repository.description }} + enable-url-completion: true diff --git a/docker/Dockerfile b/docker/Dockerfile index ea3cad7..6270687 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -1,17 +1,7 @@ FROM python:3.9-slim-buster LABEL maintainer="Darius Stefan " -RUN apt-get -y update -qq && \ - apt-get -y install git - -RUN git clone https://github.com/OpenSIPS/python-opensips.git /usr/src/python-opensips && \ - cd /usr/src/python-opensips && \ - python3 setup.py install &&\ - cd / && rm -rf /usr/src/python-opensips - -RUN apt-get purge -y git && \ - apt-get autoremove -y && \ - apt-get clean +RUN pip install opensips ADD "run.sh" "/run.sh"