From 06876c590a1daee33c857ff4452cd3229f86e75a Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 11:16:01 +0000 Subject: [PATCH 1/2] feat: Add Dockerfile and automate Docker Hub publishing - Create an Alpine-based, multi-stage Dockerfile for gitpoll. - Ensure `git`, `bash`, and `openssh` runtime dependencies are installed in the final image. - Add GitHub Actions steps in `ci-cd.yaml` to login, build, and push the Docker image to Docker Hub (`starpia/gitpoll`) on release. - Automatically tag images with the semantic release version and `latest`. Co-authored-by: starpia-forge <157299292+starpia-forge@users.noreply.github.com> --- .github/workflows/ci-cd.yaml | 22 ++++++++++++++++++++++ Dockerfile | 30 ++++++++++++++++++++++++++++++ 2 files changed, 52 insertions(+) create mode 100644 Dockerfile diff --git a/.github/workflows/ci-cd.yaml b/.github/workflows/ci-cd.yaml index ded2f5d..743ca3b 100644 --- a/.github/workflows/ci-cd.yaml +++ b/.github/workflows/ci-cd.yaml @@ -67,6 +67,7 @@ jobs: go build -o gitpoll ./cmd/gitpoll - name: Semantic Release + id: semantic uses: cycjimmy/semantic-release-action@v4 env: GITHUB_TOKEN: ${{ secrets.GH_TOKEN }} @@ -75,3 +76,24 @@ jobs: @semantic-release/commit-analyzer @semantic-release/release-notes-generator @semantic-release/github + + - name: Set up Docker Buildx + if: steps.semantic.outputs.new_release_published == 'true' + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + if: steps.semantic.outputs.new_release_published == 'true' + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USER }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Build and push Docker image + if: steps.semantic.outputs.new_release_published == 'true' + uses: docker/build-push-action@v5 + with: + context: . + push: true + tags: | + starpia/gitpoll:${{ steps.semantic.outputs.new_release_version }} + starpia/gitpoll:latest diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..a19c37b --- /dev/null +++ b/Dockerfile @@ -0,0 +1,30 @@ +# Build stage +FROM golang:alpine AS builder +WORKDIR /app + +# Download dependencies +COPY go.mod go.sum ./ +RUN go mod download + +# Copy the source code +COPY . . + +# Build the application +RUN CGO_ENABLED=0 GOOS=linux go build -o gitpoll ./cmd/gitpoll + +# Final stage +FROM alpine:latest + +# Install necessary runtime dependencies (git, bash, openssh) +RUN apk add --no-cache git bash openssh + +WORKDIR /app + +# Copy the binary from the builder stage +COPY --from=builder /app/gitpoll . + +# Ensure the binary is executable +RUN chmod +x ./gitpoll + +# Set the entrypoint +ENTRYPOINT ["./gitpoll"] From d6ac95ed6a27076a074e83929150aea8749bb098 Mon Sep 17 00:00:00 2001 From: "google-labs-jules[bot]" <161369871+google-labs-jules[bot]@users.noreply.github.com> Date: Fri, 6 Mar 2026 12:18:21 +0000 Subject: [PATCH 2/2] docs: Update README.md with Docker instructions - Add instructions on how to run `gitpoll` via Docker to the `README.md`. - Provide an example `docker run` command using the `starpia/gitpoll:latest` image. - Explain the necessity of the `-it` flag for the interactive TUI setup wizard. - Explain how to mount the `gitpoll.config.json` configuration file and local repository directory using `-v` to ensure correct application behavior and state persistence. Co-authored-by: starpia-forge <157299292+starpia-forge@users.noreply.github.com> --- README.md | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/README.md b/README.md index 6c75cd6..4ec5795 100644 --- a/README.md +++ b/README.md @@ -65,6 +65,7 @@ Configuration is managed locally through a JSON file and an interactive TUI setu ### Running the Application +#### Option 1: Direct Execution 1. Download the latest pre-built binary from the GitHub Releases page, or build it yourself (`go build ./cmd/gitpoll`). 2. Run the executable: @@ -76,6 +77,19 @@ Configuration is managed locally through a JSON file and an interactive TUI setu 4. Follow the paginated on-screen prompts in the terminal to configure the repository URL, local directory, branch, execution command, and polling interval. You can leave fields blank to use the suggested defaults shown in brackets. 5. Review the summary of your settings and confirm to save them to `./gitpoll.config.json`. +#### Option 2: Docker + +You can run `gitpoll` in a Docker container using the pre-built image hosted on Docker Hub. This method provides an isolated environment and requires no local installation other than Docker. + +```bash +docker run -it \ + -v $(pwd)/gitpoll.config.json:/app/gitpoll.config.json \ + -v /path/to/your/local/repo:/app/repo \ + starpia/gitpoll:latest +``` + +*Note: Since the application runs via a Terminal UI (TUI) and uses interactive prompts for setup, you need to use the `-it` flag. You should also mount your configuration file and target repository directory using `-v` so the container can access your data and save your settings persistently.* + ## License All code was written by `jules`.