This repository has been archived by the owner on Jan 6, 2024. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 60
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge branch 'main' of https://github.com/acheong08/obsidian-sync
- Loading branch information
Showing
2 changed files
with
58 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
# This workflow will build a golang project | ||
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-go | ||
|
||
name: Go | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v3 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v4 | ||
with: | ||
go-version: '1.20' | ||
|
||
- name: Build | ||
run: go build -v ./... | ||
|
||
- name: Test | ||
run: go test -v ./... |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
# Build the application from source | ||
FROM golang:1.20 AS build-stage | ||
|
||
WORKDIR /app | ||
|
||
COPY go.mod go.sum ./ | ||
RUN go mod download | ||
|
||
COPY . . | ||
|
||
RUN CGO_ENABLED=0 GOOS=linux go build -trimpath -o /obsidian-sync ./cmd/obsidian-sync/ | ||
|
||
# Deploy the application binary into a lean image | ||
FROM gcr.io/distroless/base-debian11 AS build-release-stage | ||
|
||
WORKDIR / | ||
|
||
COPY --from=build-stage /obsidian-sync /obsidian-sync | ||
|
||
ENV HOST=0.0.0.0 | ||
|
||
EXPOSE 3000 | ||
|
||
#USER nonroot:nonroot | ||
|
||
ENTRYPOINT ["/obsidian-sync"] | ||
|
||
CMD ["/obsidian-sync"] |