-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
3 changed files
with
69 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,26 @@ | ||
# See LICENSE file for copyright and license information | ||
name: CI | ||
|
||
on: | ||
push: | ||
branches: [ "main" ] | ||
pull_request: | ||
branches: [ "main" ] | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
steps: | ||
- uses: actions/checkout@v4 | ||
|
||
- name: Set up Go | ||
uses: actions/setup-go@v5 | ||
with: | ||
go-version: '1.22.x' | ||
|
||
- name: Setup go-task | ||
uses: lukeshay/setup-task@v1 | ||
|
||
- name: Test | ||
run: task ci |
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,16 @@ | ||
# Copyright 2024 Daniel Moch, all rights reserved | ||
FROM golang:1.21-alpine AS build | ||
|
||
RUN mkdir -p djmo.ch/dgit | ||
|
||
COPY ./ /djmo.ch/dgit/ | ||
|
||
RUN cd /djmo.ch/dgit/cmd/dgit && CGO_ENABLED=0 go build ./ | ||
|
||
FROM scratch | ||
|
||
COPY --from=build /djmo.ch/dgit/cmd/dgit/dgit /usr/local/bin/ | ||
|
||
CMD ["/usr/local/bin/dgit"] | ||
|
||
USER 1001 |
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,27 @@ | ||
#!/bin/sh | ||
set -eu | ||
|
||
# See LICENSE file for copyright and license details | ||
|
||
[ -d .git ] || { echo "not at repo root ... exiting"; exit 1; } | ||
|
||
usage() { | ||
echo "usage: $0 BUILD_TAG" | ||
} | ||
|
||
build() { | ||
BUILD_TAG=$1 | ||
docker build -t $BUILD_TAG . | ||
} | ||
|
||
main() { | ||
case "$1" in | ||
"-h"|"--help"|"help") | ||
usage | ||
exit | ||
;; | ||
*) | ||
build | ||
;; | ||
esac | ||
} |