Skip to content

Commit

Permalink
fix date
Browse files Browse the repository at this point in the history
  • Loading branch information
le0pard committed Jul 6, 2024
1 parent 707a5a5 commit 75c54e8
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
3 changes: 3 additions & 0 deletions .github/workflows/build-and-release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,9 @@ jobs:
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max
build-args: |
BUILD_VERSION=${{ github.ref_name }}
BUILD_GIT_COMMIT=${{ github.sha }}
- name: Generate artifact attestation
uses: actions/attest-build-provenance@v1
Expand Down
5 changes: 4 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@ FROM golang:1.22

# args
ARG TARGETARCH
ARG BUILD_VERSION
ARG BUILD_GIT_COMMIT
ARG GIN_MODE=release

# Set up environment variables
Expand Down Expand Up @@ -43,7 +45,8 @@ RUN go mod download
COPY . ./

# Build the binary.
RUN go build -trimpath -ldflags="-s -w" -v -o postal_server
RUN BUILD_TIME=$(date +"%Y-%m-%dT%H:%M:%S%z") \
go build -trimpath -ldflags="-s -w" -ldflags="-X github.com/le0pard/postal_server/version.Version=${BUILD_VERSION}" -ldflags="-X github.com/le0pard/postal_server/version.GitCommit=${BUILD_GIT_COMMIT}" -ldflags="-X github.com/le0pard/postal_server/version.BuildTime=${BUILD_TIME}" -v -o postal_server

EXPOSE 8000
# Run the web service on container startup.
Expand Down

0 comments on commit 75c54e8

Please sign in to comment.