This repository was archived by the owner on Jan 6, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Expand file tree Collapse file tree 2 files changed +58
-0
lines changed Original file line number Diff line number Diff line change
1
+ # This workflow will build a golang project
2
+ # For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go
3
+
4
+ name : Go
5
+
6
+ on :
7
+ push :
8
+ branches : [ "main" ]
9
+ pull_request :
10
+ branches : [ "main" ]
11
+
12
+ jobs :
13
+
14
+ build :
15
+ runs-on : ubuntu-latest
16
+ steps :
17
+ - uses : actions/checkout@v3
18
+
19
+ - name : Set up Go
20
+ uses : actions/setup-go@v4
21
+ with :
22
+ go-version : ' 1.20'
23
+
24
+ - name : Build
25
+ run : go build -v ./...
26
+
27
+ - name : Test
28
+ run : go test -v ./...
Original file line number Diff line number Diff line change
1
+ # syntax=docker/dockerfile:1
2
+
3
+ # Build the application from source
4
+ FROM golang:1.20 AS build-stage
5
+
6
+ WORKDIR /app
7
+
8
+ COPY go.mod go.sum ./
9
+ RUN go mod download
10
+
11
+ COPY . .
12
+
13
+ RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -o /obsidian-sync ./cmd/obsidian-sync/
14
+
15
+ # Deploy the application binary into a lean image
16
+ FROM gcr.io/distroless/base-debian11 AS build-release-stage
17
+
18
+ WORKDIR /
19
+
20
+ COPY --from=build-stage /obsidian-sync /obsidian-sync
21
+
22
+ ENV HOST=0.0.0.0
23
+
24
+ EXPOSE 3000
25
+
26
+ # USER nonroot:nonroot
27
+
28
+ ENTRYPOINT ["/obsidian-sync" ]
29
+
30
+ CMD ["/obsidian-sync" ]
You can’t perform that action at this time.
0 commit comments