Skip to content

Commit

Permalink
Update Docker and Github Workflows
Browse files Browse the repository at this point in the history
  • Loading branch information
Amaototi committed Jun 20, 2023
1 parent b01f075 commit d972a49
Show file tree
Hide file tree
Showing 3 changed files with 50 additions and 5 deletions.
1 change: 1 addition & 0 deletions .github/workflows/docker-image.yml
Original file line number Diff line number Diff line change
Expand Up @@ -22,5 +22,6 @@ jobs:
id: docker_build
uses: docker/build-push-action@v3
with:
platforms: linux/amd64,linux/arm64,linux/arm/v6,linux/arm/v7
push: true
tags: ghcr.io/tpc3/noa:latest
47 changes: 47 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
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-amd64
goos: linux
goarch: amd64
- arch: linux-arm
goos: linux
goarch: arm
- arch: linux-arm64
goos: linux
goarch: arm64

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
7 changes: 2 additions & 5 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,10 @@
FROM golang
RUN apt update && apt install -y mecab libmecab-dev mecab-ipadic-utf8
RUN apt update
ENV GO111MODULE on
ENV CGO_LDFLAGS -L/usr/lib/x86_64-linux-gnu -lmecab -lstdc++
ENV CGO_CFLAGS -I/usr/include
RUN ln -s /usr/local/lib/libmecab.so.2.0.0 /lib64/libmecab.so.2
ADD . /go/src/Noa/
ARG GOARCH=amd64
ENV GOARCH ${GOARCH}
ENV CGO_ENABLED 1
ENV CGO_ENABLED 0
WORKDIR /go/src/Noa
RUN go build -o noa .
CMD ["./noa"]

0 comments on commit d972a49

Please sign in to comment.