Skip to content

Commit

Permalink
add CI workflow
Browse files Browse the repository at this point in the history
  • Loading branch information
djmoch committed Jun 13, 2024
1 parent 938c6f5 commit bd77749
Show file tree
Hide file tree
Showing 3 changed files with 69 additions and 0 deletions.
26 changes: 26 additions & 0 deletions .github/workflows/ci.yml
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
16 changes: 16 additions & 0 deletions Dockerfile
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
27 changes: 27 additions & 0 deletions devtools/build_deployment.sh
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
}

0 comments on commit bd77749

Please sign in to comment.