From 49c8c6a30524ebc806c971e6edfc40fcec35e4b6 Mon Sep 17 00:00:00 2001 From: Wesley van Tilburg Date: Thu, 2 Jan 2025 17:18:29 +0100 Subject: [PATCH] feat: initial ci setup --- .gitea/workflows/ci.yaml | 24 ++++++++++++++++++++++++ Containerfile | 13 +++++++++++++ 2 files changed, 37 insertions(+) create mode 100644 .gitea/workflows/ci.yaml create mode 100644 Containerfile diff --git a/.gitea/workflows/ci.yaml b/.gitea/workflows/ci.yaml new file mode 100644 index 0000000..109b77b --- /dev/null +++ b/.gitea/workflows/ci.yaml @@ -0,0 +1,24 @@ +name: Build container +on: + push: + +jobs: + build: + runs-on: container-builder + steps: + - uses: actions/checkout@v4 + - name: Build + uses: redhat-actions/buildah-build@v2 + with: + image: ${{ github.actor }}/${{ github.event.repository.name }} + tags: latest + containerfiles: | + ./Containerfile + - name: Push + uses: redhat-actions/push-to-registry@v2 + with: + image: ${{ github.actor }}/${{ github.event.repository.name }} + tags: ${{ github.ref_name }} + registry: git.plabble.org + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_TOKEN }} diff --git a/Containerfile b/Containerfile new file mode 100644 index 0000000..a78a386 --- /dev/null +++ b/Containerfile @@ -0,0 +1,13 @@ +FROM golang:1.23 as builder + +WORKDIR /app +COPY ./ ./ +RUN go mod download +RUN go build -o director ./cmd/director + +FROM alpine:3.21 +WORKDIR /app +COPY --from=builder /app/director . + +EXPOSE 8080 +CMD ["./director"]