Skip to content
This repository was archived by the owner on Jan 6, 2024. It is now read-only.

Commit aca1581

Browse files
author
Antonio Cheong
committed
2 parents 53e4d8e + a5250cc commit aca1581

File tree

2 files changed

+58
-0
lines changed

2 files changed

+58
-0
lines changed

.github/workflows/go.yml

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
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 ./...

Dockerfile

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,30 @@
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"]

0 commit comments

Comments
 (0)