From 5a309e45fedb150be34952616f7853d0347119f5 Mon Sep 17 00:00:00 2001 From: Blitblank Date: Sat, 28 Feb 2026 14:52:59 -0600 Subject: [PATCH] preliminary ci/cd setup (horrors await me) --- .gitea/workflows/deploy-api.yaml | 32 ++++++++++++++++++++++++++++ .gitea/workflows/deploy-client.yaml | 33 +++++++++++++++++++++++++++++ docker-compose.prod.yaml | 23 ++++++++++++++++++++ 3 files changed, 88 insertions(+) create mode 100644 .gitea/workflows/deploy-api.yaml create mode 100644 .gitea/workflows/deploy-client.yaml create mode 100644 docker-compose.prod.yaml diff --git a/.gitea/workflows/deploy-api.yaml b/.gitea/workflows/deploy-api.yaml new file mode 100644 index 0000000..9042d2a --- /dev/null +++ b/.gitea/workflows/deploy-api.yaml @@ -0,0 +1,32 @@ + +name: Build and Deploy API + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: docker + + steps: + - name: Checkout code + uses: actions/checkout@v3 + + - name: Validate Registry + run: | + echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login git.bxvard.net -u ${{ secrets.REGISTRY_USERNAME }} --password-stdin + + - name: Build Docker image + run: | + docker build -t git.bxvard.net/homeburger/agologum-api:latest ./api + + - name: Push image + run: | + docker push git.vxbard.net/homeburger/agologum-api:latest + + - name: Deploy container + run: | + docker compose -f docker-compose.prod.yaml pull agologum-api + docker compose -f docker-compose.prod.yaml up -d agologum-api \ No newline at end of file diff --git a/.gitea/workflows/deploy-client.yaml b/.gitea/workflows/deploy-client.yaml new file mode 100644 index 0000000..6405a22 --- /dev/null +++ b/.gitea/workflows/deploy-client.yaml @@ -0,0 +1,33 @@ + +name: Build and Deploy Frontend + +on: + push: + branches: + - main + +jobs: + build-and-deploy: + runs-on: docker + + steps: + - uses: actions/checkout@v3 + + - name: Login to Registry + run: | + echo "${{ secrets.REGISTRY_PASSWORD }}" | docker login yourdomain.com \ + -u ${{ secrets.REGISTRY_USERNAME }} \ + --password-stdin + + - name: Build image + run: | + docker build -t yourdomain.com/owner/frontend:latest . + + - name: Push + run: | + docker push yourdomain.com/owner/frontend:latest + + - name: Deploy + run: | + docker compose -f /path/to/docker-compose.yml pull frontend + docker compose -f /path/to/docker-compose.yml up -d frontend \ No newline at end of file diff --git a/docker-compose.prod.yaml b/docker-compose.prod.yaml new file mode 100644 index 0000000..73407f0 --- /dev/null +++ b/docker-compose.prod.yaml @@ -0,0 +1,23 @@ + +services: + api: + image: git.vxbard.net/homeburger/agologum-api:latest + container_name: agologum-api + restart: always + ports: + - "5000:80" + networks: + - web + + client: + image: git.vxbard.net/homeburger/agologum-client:latest + container_name: agologum-client + restart: always + ports: + - "8080:80" + networks: + - web + +networks: + web: + external: true