diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 88bc5d5..62e9864 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -123,9 +123,9 @@ jobs: - name: build self-contained executable run: | set -eux - + pdm run compile - + ls -l dist - name: run self-contained executable @@ -151,6 +151,17 @@ jobs: docker run --rm second-hand-friends/kleinanzeigen-bot help + - name: "Publish docker image" + if: startsWith(matrix.os, 'ubuntu') && github.ref == 'refs/heads/main' + run: | + set -eux + + echo "${{ github.token }}" | docker login https://ghcr.io -u ${{ github.actor }} --password-stdin + + image_name="second-hand-friends/kleinanzeigen-bot" + docker image tag $image_name ghcr.io/$image_name + docker push ghcr.io/$image_name + ########################################################### publish-release: diff --git a/README.md b/README.md index 88e52c8..546e9bb 100644 --- a/README.md +++ b/README.md @@ -69,6 +69,32 @@ It is the spiritual successor to [Second-Hand-Friends/ebayKleinanzeigen](https:/ ./kleinanzeigen-bot --help ``` +### Installation using Docker + +1. The following components need to be installed: + 1. [Docker](https://www.docker.com/) + 1. [Bash](https://www.gnu.org/software/bash/) (on Windows e.g. via [Cygwin](https://www.cygwin.com/), [MSys2](https://www.msys2.org/) or git) + 1. [X11 - X Window System](https://en.wikipedia.org/wiki/X_Window_System) display server (on Windows e.g. https://github.com/P-St/Portable-X-Server/releases/latest) + +**Running the docker image:** +1. Ensure the X11 Server is running + +1. Run the docker image: + + ```bash + X11_DISPLAY=192.168.50.34:0.0 # replace with IP address of workstation where X11 server is running + + DATA_DIR=/var/opt/data/kleinanzeigen-bot # path to config + + # /mnt/data is the container's default working directory + docker run --rm --interactive --tty \ + --shm-size=256m \ + -e DISPLAY=$X11_DISPLAY \ + -v $DATA_DIR:/mnt/data \ + ghcr.io/second-hand-friends/kleinanzeigen-bot \ + --help + ``` + ### Installation from source 1. The following components need to be installed: @@ -101,7 +127,7 @@ It is the spiritual successor to [Second-Hand-Friends/ebayKleinanzeigen](https:/ pdm run app --help ``` -### Installation using Docker +### Installation from source using Docker 1. The following components need to be installed: 1. [Docker](https://www.docker.com/) diff --git a/docker/build-image.sh b/docker/build-image.sh index 5972164..7a3abb3 100644 --- a/docker/build-image.sh +++ b/docker/build-image.sh @@ -63,13 +63,3 @@ docker build "$project_root" \ --build-arg GIT_REPO_URL="$(git config --get remote.origin.url)" \ -t $image_name \ "$@" - - -################################################# -# push image with tags to remote docker image registry -################################################# -if [[ "${DOCKER_PUSH:-0}" == "1" ]]; then - docker image tag $image_name docker.io/$image_name - - docker push docker.io/$image_name -fi