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
18 changes: 10 additions & 8 deletions .github/workflows/go.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,24 +12,22 @@ jobs:
runs-on: ubuntu-latest
name: Test and Build
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26'
cache: true
- name: Test
Comment on lines +16 to 19
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Go version in CI is pinned to 1.26 while go.mod declares go 1.25.0. To keep toolchains consistent across local builds, Docker builds, and CI, consider aligning these (either bump go.mod to 1.26 if intended, or run CI with 1.25.x).

Copilot uses AI. Check for mistakes.
run: go test ./...

code_quality:
name: Code Quality🎖️
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- uses: actions/setup-go@v4
- uses: actions/checkout@v6
- uses: actions/setup-go@v6
with:
go-version: '1.26'
cache: true
- uses: golangci/golangci-lint-action@v8
- uses: golangci/golangci-lint-action@v9
Comment on lines +26 to +30
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-go no longer enables module/build caching here (the previous cache: true was removed and there’s no actions/cache usage elsewhere). This will slow down PR CI runs; consider re-enabling caching (via setup-go’s cache option if still supported, or explicit actions/cache for ~/go/pkg/mod and ~/.cache/go-build).

Copilot uses AI. Check for mistakes.
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

actions/setup-go@v6 has cache enabled by default

with:
version: v2.10.1
args: --timeout 9m0s
Expand Down Expand Up @@ -67,7 +65,7 @@ jobs:
contents: read
packages: write
steps:
- uses: actions/checkout@v4
- uses: actions/checkout@v6

- uses: docker/setup-buildx-action@v3

Expand All @@ -84,9 +82,13 @@ jobs:
push: true
context: .
file: Dockerfile
platforms: linux/amd64,linux/arm64
provenance: true
sbom: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
${{ vars.DOCKER_REGISTRY_TARGET }}:${{ env.RELEASE_VERSION }}

- name: Output Image Path
run: echo "Image pushed to ${{ vars.DOCKER_REGISTRY_TARGET }}:${{ env.RELEASE_VERSION }}"
8 changes: 5 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Build stage
FROM golang:1.26 AS build
# Build stage - runs on native platform, cross-compiles to target
FROM --platform=$BUILDPLATFORM golang:1.26 AS build
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Docker image uses golang:1.26, but go.mod declares go 1.25.0. If 1.26 is required, consider updating go.mod (and any local/toolchain docs) to match; otherwise pin the Docker build stage to the same Go version as go.mod to avoid CI/local mismatches.

Suggested change
FROM --platform=$BUILDPLATFORM golang:1.26 AS build
FROM --platform=$BUILDPLATFORM golang:1.25.0 AS build

Copilot uses AI. Check for mistakes.

WORKDIR /src

Expand All @@ -9,7 +9,9 @@ RUN go mod download

# Copy source code (this layer changes frequently)
COPY . .
RUN CGO_ENABLED=0 go build -ldflags="-s -w" -o /app/main main.go

ARG TARGETARCH
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /app/main main.go
Copy link

Copilot AI Mar 5, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ARG TARGETARCH is required for the GOARCH=${TARGETARCH} build. If someone builds with a non-BuildKit/legacy builder where TARGETARCH isn't automatically provided, this will produce an empty GOARCH and fail the build. Consider adding a safe default (e.g., fall back to go env GOARCH) so docker build . works reliably without requiring extra flags.

Suggested change
RUN CGO_ENABLED=0 GOOS=linux GOARCH=${TARGETARCH} go build -ldflags="-s -w" -o /app/main main.go
RUN export GOARCH=${TARGETARCH:-$(go env GOARCH)} \
&& CGO_ENABLED=0 GOOS=linux GOARCH=$GOARCH go build -ldflags="-s -w" -o /app/main main.go

Copilot uses AI. Check for mistakes.

# Final stage - distroless
FROM gcr.io/distroless/static-debian12
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ To deploy the server, you need to build a Docker image using the provided `Docke
```dockerfile
# Use the official static-server image as the base image
# This will pull the prebuilt version of the static-server to run your static website
FROM zopdev/static-server:v0.0.6
FROM zopdev/static-server:v0.0.7

# Copy static files into the container
# The 'COPY' directive moves your static files (in this case, located at '/app/out') into the '/website' directory
Expand Down