Skip to content

Commit

Permalink
Update workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaototi committed Jun 11, 2023
1 parent c024bd8 commit 116b65d
Show file tree
Hide file tree
Showing 3 changed files with 54 additions and 2 deletions.
3 changes: 3 additions & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,8 @@ jobs:
id: docker_build
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
cache-from: type=registry,ref=ghcr.io/tpc3/noa:buildcache
cache-to: type=registry,ref=ghcr.io/tpc3/noa:buildcache,mode=max
tags: ghcr.io/tpc3/noa:latest
49 changes: 49 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
name: Go

on:
push:
branches: [ master ]
pull_request:
branches: [ master ]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
arch: [linux-amd64, linux-arm, linux-arm64]
include:
- arch: linux-386
goos: linux
goarch: 386
- arch: linux-amd64
goos: linux
goarch: amd64
- arch: linux-arm
goos: linux
goarch: arm
- arch: linux-arm64
goos: linux

steps:
- uses: actions/checkout@v2

- name: Set up Go
uses: actions/setup-go@v2
with:
go-version: 1.19

- name: Build
run: mkdir -p bin/${{ matrix.goos }}/${{ matrix.goarch }}
- name: Build
run: go build -o bin/${{ matrix.goos }}/${{ matrix.goarch }}/
env:
CGO_ENABLED: 0
GOARCH: ${{ matrix.goarch }}
GOOS: ${{ matrix.goos }}

- name: Upload a Build Artifact
uses: actions/upload-artifact@v2.2.4
with:
# Artifact name
path: bin
4 changes: 2 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM golang:latest AS build
FROM golang
RUN apt update && apt install -y mecab libmecab-dev mecab-ipadic-utf8
ENV GO111MODULE on
ENV CGO_LDFLAGS -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++
Expand All @@ -10,4 +10,4 @@ ENV GOARCH ${GOARCH}
ENV CGO_ENABLED 1
WORKDIR /go/src/Noa
RUN go build -o noa .
CMD ["./noa"]
CMD ["./noa"]

0 comments on commit 116b65d

Please sign in to comment.