From c2e86c9ce428762b2f31b371bdbed718dff2b501 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Niklas=20M=C3=BCller?= Date: Fri, 22 Dec 2023 14:32:18 +0100 Subject: [PATCH] ci|cd setup --- .gitea/workflows/gitea-ci.yaml | 67 ++++++++++++++++++++++++++++++++++ 1 file changed, 67 insertions(+) create mode 100644 .gitea/workflows/gitea-ci.yaml diff --git a/.gitea/workflows/gitea-ci.yaml b/.gitea/workflows/gitea-ci.yaml new file mode 100644 index 0000000..711485f --- /dev/null +++ b/.gitea/workflows/gitea-ci.yaml @@ -0,0 +1,67 @@ +name: Build and Deploy docker-llamafile +on: [push] + +jobs: + # Environment/Checks + check-docker-state: + name: Check Docker State + runs-on: host + tags: + - live + steps: + - run: whoami + - run: uname -a + - run: /usr/bin/docker ps + - run: docker ps + + # Version-Controll + git-llamafile: + # name: Checkout docker-llamafile + runs-on: host + tags: + - live + steps: + - run: apt install git || true + - run: (cd /root && git clone https://gitea.tidoni-sky.ddnss.de/tidoni/docker-llamafile.git || true) + - run: (cd /root/docker-llamafile && git pull) + + + # Build + bld-llamafile: + # name: Build docker-llamafile + runs-on: host + tags: + - live + needs: [ git-llamafile ] + if: | + always() + steps: + - run: (cd /root/docker-llamafile && docker build -t tidoni/llamafile:latest .) + + + # Deploy + push-llamafile: + # name: Deploy pdf-web-toolkit + runs-on: host + tags: + - live + needs: [ git-llamafile, bld-llamafile ] + if: | + always() + steps: + - run: docker push tidoni/llamafile:latest + + + # Deploy + dpy-llamafile: + # name: Deploy pdf-web-toolkit + runs-on: host + tags: + - live + needs: [ git-llamafile, bld-llamafile ] + if: | + always() + steps: + - run: docker stop llama || true + - run: docker rm llama || true + - run: docker run -d --name llama --restart unless-stopped -p 8102:8080 -t tidoni/llamafile:latest