From 7717483821bdc7e4ef77f4af218b44ebc56a7997 Mon Sep 17 00:00:00 2001 From: Erki Date: Thu, 26 Sep 2024 09:06:05 +0300 Subject: [PATCH] CI and container publishing --- .gitea/workflows/ci.yml | 27 +++++++++++++++++++++++++++ Dockerfile | 17 +++++++++++++++++ 2 files changed, 44 insertions(+) create mode 100644 .gitea/workflows/ci.yml create mode 100644 Dockerfile diff --git a/.gitea/workflows/ci.yml b/.gitea/workflows/ci.yml new file mode 100644 index 0000000..2f3c663 --- /dev/null +++ b/.gitea/workflows/ci.yml @@ -0,0 +1,27 @@ +name: Build and push latest +run-name: Build and push latest +on: [push] + +jobs: + publish: + runs-on: ubuntu-latest + if: gitea.ref == 'refs/heads/master' + steps: + - uses: actions/checkout@v4 + + - name: Setup Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to registry + uses: docker/login-action@v3 + with: + registry: git.skullnet.me + username: ${{ secrets.REGISTRY_USERNAME }} + password: ${{ secrets.REGISTRY_PASSWORD }} + + - name: Build and push + uses: docker/build-push-action@v6 + with: + push: true + tags: "git.skullnet.me/erki/embeddingcpp:latest" + file: Dockerfile \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..10d7e0d --- /dev/null +++ b/Dockerfile @@ -0,0 +1,17 @@ +FROM alpine:3.20 AS build + +RUN apk add --update hugo + +WORKDIR /opt/hugoapp + +COPY . . + +RUN hugo + +FROM nginx:1.27.1-alpine + +WORKDIR /usr/share/nginx/html + +COPY --from=build /opt/hugoapp/public . + +EXPOSE 80/tcp