Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
22 changes: 22 additions & 0 deletions .github/workflows/ci-cd.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -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 }}
Expand All @@ -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
30 changes: 30 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -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"]
14 changes: 14 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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:

Expand All @@ -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`.