Add docker file and other github actions

This commit is contained in:
James Coleman 2024-11-30 10:42:18 -06:00
parent c4882ff8a5
commit 54c7a3c670
4 changed files with 71 additions and 5 deletions

View File

@ -33,7 +33,7 @@ jobs:
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
with:
images: |
grmrgecko/osc-mqtt-bridge
grmrgecko/midi-request-trigger
ghcr.io/${{ github.repository }}
- name: Build and push Docker images

29
.github/workflows/release.yaml vendored Normal file
View File

@ -0,0 +1,29 @@
on:
release:
types: [created]
permissions:
contents: write
packages: write
jobs:
goreleaser:
runs-on: ubuntu-latest
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Set up Go
uses: actions/setup-go@v4
-
name: Run GoReleaser
uses: goreleaser/goreleaser-action@v6
with:
distribution: goreleaser
version: latest
args: release --clean
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

21
.github/workflows/test_golang.yaml vendored Normal file
View File

@ -0,0 +1,21 @@
name: Go package
on: [push]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Set up Go
uses: actions/setup-go@v4
with:
go-version: '1.21'
- name: Build
run: go build -v ./...
- name: Test
run: go test -v ./...

16
Dockerfile Normal file
View File

@ -0,0 +1,16 @@
FROM golang:1.20
# Build app
WORKDIR /app
COPY go.mod go.sum ./
RUN go mod download
COPY *.go ./
RUN go build -o /midi-request-trigger
WORKDIR /app
RUN rm -Rf /app; mkdir /etc/midi-request-trigger
# Configuration volume
VOLUME ["/etc/midi-request-trigger"]
# Command
CMD ["/midi-request-trigger"]