Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
30 changes: 28 additions & 2 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ name: Go
on:
push:
branches: [ "main" ]
tags: ["V*.*.*"]
pull_request:
branches: [ "main" ]

permissions: read-all

jobs:

build:
runs-on: ubuntu-24.04-arm
steps:
Expand All @@ -21,7 +21,7 @@ jobs:
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056
with:
image: ghcr.io/${{ github.repository }}
tags: ${{ github.sha }}
tags: ${{ github.event_type == 'push' && github.ref_name || github.sha }}
containerfiles: |
./Containerfile
extra-args: |
Expand All @@ -31,3 +31,29 @@ jobs:
- name: Run go test
run: podman run ghcr.io/${{ github.repository }}:${{ github.sha }} go test -v ./...

- name: Buildah Action
# Push events mean either a tag or main branch
if: github.event_name == 'push'
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056
with:
image: ghcr.io/${{ github.repository }}
tags: ${{ github.ref_name }}
containerfiles: |
./Containerfile
extra-args: |
--target=delivery

# Push the image to GHCR (Image Registry)
- name: Push To GHCR
# Push events mean either a tag or main branch
if: github.event_name == 'push'
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c # v2.8
id: push
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.build_image.outputs.tags }}
registry: ghcr.io/${{ github.repository }}
username: ${{ github.actor }}
password: ${{ github.token }}
extra-args: |
--disable-content-trust
2 changes: 1 addition & 1 deletion Containerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ COPY . .
RUN apk add build-base musl-dev opencv-dev icu-libs --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
RUN go build cmd/main.go

FROM docker.io/alpine:3.21
FROM docker.io/alpine:3.21 AS delivery
WORKDIR /app
RUN apk add musl opencv-dev icu-libs --repository=https://dl-cdn.alpinelinux.org/alpine/edge/community
COPY --from=build /app/main /app/main
Expand Down