Skip to content

Commit

Permalink
ci: Optimize docker cache
Browse files Browse the repository at this point in the history
  • Loading branch information
flemzord committed Dec 20, 2022
1 parent 655feec commit 8ba589d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 6 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ jobs:
with:
go-version-file: 'go.mod'
cache: true
- run: go mod download
- run: go mod vendor
- uses: docker/setup-qemu-action@v2
- uses: docker/setup-buildx-action@v2
- uses: docker/login-action@v2
Expand Down
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,10 @@ ARG VERSION
WORKDIR /go/src/github.com/formancehq/payments

# get deps first so it's cached
COPY go.mod .
COPY go.sum .

RUN go mod download

COPY . .

RUN go mod vendor

RUN CGO_ENABLED=0 GOOS=linux GOARCH=$TARGETARCH \
CC=$TARGETARCH-linux-gnu-gcc \
go build -o bin/payments \
Expand Down

0 comments on commit 8ba589d

Please sign in to comment.