Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

refactor: test out new build process #110

Closed
wants to merge 5 commits into from
Closed
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
3 changes: 1 addition & 2 deletions .github/workflows/cpr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ jobs:
uses: ./
with:
access_token: ${{ secrets.ACCESS_TOKEN }}
edit: true
verbose: true

16 changes: 12 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:1.18
FROM golang:1.18 as builder

WORKDIR /ci

Expand All @@ -9,8 +9,16 @@ RUN go mod download

COPY . .

RUN go build -a -o cpr .
ENV GOCACHE=/root/.cache/go-build
RUN --mount=type=cache,target="/root/.cache/go-build" go build -o cpr .

RUN chmod +x /ci/cpr
FROM ubuntu:22.04

CMD ["/ci/cpr"]
RUN mkdir /app
WORKDIR /app

RUN apt-get update && apt-get install -y --no-install-recommends ca-certificates

COPY --from=builder /ci/cpr /app/cpr

ENTRYPOINT ["/app/cpr"]
Loading