Add docker file and other github actions
This commit is contained in:
		
							parent
							
								
									c4882ff8a5
								
							
						
					
					
						commit
						54c7a3c670
					
				
							
								
								
									
										10
									
								
								.github/workflows/publish_docker_image.yml
									
									
									
									
										vendored
									
									
								
							
							
						
						
									
										10
									
								
								.github/workflows/publish_docker_image.yml
									
									
									
									
										vendored
									
									
								
							@ -14,28 +14,28 @@ jobs:
 | 
			
		||||
    steps:
 | 
			
		||||
      - name: Check out the repo
 | 
			
		||||
        uses: actions/checkout@v3
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
      - name: Log in to Docker Hub
 | 
			
		||||
        uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
 | 
			
		||||
        with:
 | 
			
		||||
          username: ${{ secrets.DOCKER_USERNAME }}
 | 
			
		||||
          password: ${{ secrets.DOCKER_PASSWORD }}
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
      - name: Log in to the Container registry
 | 
			
		||||
        uses: docker/login-action@65b78e6e13532edd9afa3aa52ac7964289d1a9c1
 | 
			
		||||
        with:
 | 
			
		||||
          registry: ghcr.io
 | 
			
		||||
          username: ${{ github.actor }}
 | 
			
		||||
          password: ${{ secrets.GITHUB_TOKEN }}
 | 
			
		||||
      
 | 
			
		||||
 | 
			
		||||
      - name: Extract metadata (tags, labels) for Docker
 | 
			
		||||
        id: meta
 | 
			
		||||
        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
 | 
			
		||||
        uses: docker/build-push-action@f2a1d5e99d037542a71f64918e516c093c6f3fc4
 | 
			
		||||
        with:
 | 
			
		||||
 | 
			
		||||
							
								
								
									
										29
									
								
								.github/workflows/release.yaml
									
									
									
									
										vendored
									
									
										Normal file
									
								
							
							
						
						
									
										29
									
								
								.github/workflows/release.yaml
									
									
									
									
										vendored
									
									
										Normal 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
									
								
							
							
						
						
									
										21
									
								
								.github/workflows/test_golang.yaml
									
									
									
									
										vendored
									
									
										Normal 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
									
								
							
							
						
						
									
										16
									
								
								Dockerfile
									
									
									
									
									
										Normal 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"]
 | 
			
		||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user