13 Commits

Author SHA1 Message Date
max 96b1588fcc Merge pull request 'Ci cd merge request' (#2) from ci-cd into main
Reviewed-on: #2
2026-08-05 04:57:46 +00:00
max 7f2b82aae0 .env.example is improved, comments added. docker-compose-prod.yaml is replaced with docker-compose.yaml, development version is docker-compose.override.yaml now
Build and Push Docker Image / build-and-push-backend (pull_request) Successful in 21m4s
Build and Push Docker Image / build-and-push-frontend (pull_request) Successful in 52s
Build and Push Docker Image / notify-deployment-server (pull_request) Successful in 13s
2026-08-05 09:52:23 +05:00
max a028b875fb building image actions is triggered only if a pull request has been merged into main 2026-08-05 09:07:00 +05:00
max d1a166a0f1 docker-compose-prod.yaml uses more variables from .env.example now 2026-08-05 08:52:45 +05:00
max fb9413e6f8 .env is untracked now 2026-08-04 21:50:06 +05:00
max e0490c5f41 .env.example is committed to the repo from now on. .env is used as a development file and ignored 2026-08-04 21:46:48 +05:00
max b6deed78c8 Building image action builds both images first, only then notifies the deployment server. Docker compose production file added 2026-08-04 20:41:21 +05:00
max e802b684ff Docker build context fixed in frontend building job
Build and Push Docker Image / build-and-push (push) Successful in 4m46s
2026-08-04 20:18:11 +05:00
max e28bcc27fc fixes in the build image action
Build and Push Docker Image / build-and-push (push) Failing after 1m27s
2026-08-04 20:12:41 +05:00
max 3a326859de Building image action fixed to use correct Dockerfile and build context
Build and Push Docker Image / build-and-push (push) Failing after 19m37s
2026-08-04 19:50:41 +05:00
max 26fb4fb3f4 Test CI/CD job was removed. Image building job was updated to build web version of the app
Build and Push Docker Image / build-and-push (push) Failing after 39s
2026-08-04 19:17:36 +05:00
max c455bd541b New test action added. It builds a docker image and pushes it to the registry
Build and Push Docker Image / build-and-push (push) Successful in 20m15s
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 15s
2026-08-04 10:56:01 +05:00
max c66dbf9dc3 Test CI/CD file added
Gitea Actions Demo / Explore-Gitea-Actions (push) Successful in 18s
2026-08-03 13:02:48 +05:00
6 changed files with 135 additions and 24 deletions
-8
View File
@@ -1,8 +0,0 @@
# Backend
DEBUG=0
MAX_UPLOAD_SIZE_MB=500
TEMP_DIR=/tmp/audio_splitter_web
CLEANUP_AFTER_SECONDS=3600
# Frontend (development)
VITE_BACKEND_URL=http://localhost:8000
+26
View File
@@ -0,0 +1,26 @@
# ------------------------------------------------------------------------------
# Production Environment Variables
# ------------------------------------------------------------------------------
# Backend
DEBUG=0
MAX_UPLOAD_SIZE_MB=500
CLEANUP_AFTER_SECONDS=3600
# Backend data directory (bind mount)
# This directory will store all temporary files during splitting.
# It can get large (audio files), so place it on a partition with enough space.
BACKEND_DATA_DIR=/var/lib/audio_splitter_data
# Ports
BACKEND_PORT=8000
FRONTEND_PORT=5173
# ------------------------------------------------------------------------------
# Development Overrides (docker-compose.override.yaml)
# ------------------------------------------------------------------------------
# These are only used when docker-compose.override.yaml is present.
# They override the production settings for local development.
# Frontend (development)
VITE_BACKEND_URL=http://localhost:8000
+63
View File
@@ -0,0 +1,63 @@
name: Build and Push Docker Image
on:
pull_request:
types: [closed]
branches: [ main ]
env:
REGISTRY: git.vmn.su
OWNER: max
REPO: audio_splitter
jobs:
build-and-push-backend:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
run: |
echo "${{ secrets.CI_PUSHER_GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
- name: Build backend image
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} -f ./web/backend/Dockerfile .
docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest
- name: Push backend image
run: |
docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }}
docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest
build-and-push-frontend:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Log in to Gitea Container Registry
run: |
echo "${{ secrets.CI_PUSHER_GITEA_TOKEN }}" | docker login ${{ env.REGISTRY }} -u ${{ github.actor }} --password-stdin
- name: Build frontend image
run: |
docker build -t ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} -f ./web/frontend/Dockerfile ./web/frontend
docker tag ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest
- name: Push frontend image
run: |
docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }}
docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest
notify-deployment-server:
if: github.event.pull_request.merged == true
runs-on: ubuntu-latest
steps:
- name: Trigger the webhook on the deployment server to start pulling the images
run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter"
+1
View File
@@ -7,3 +7,4 @@ test_data/
venv/
web/frontend/node_modules
TODO.md
.env
+37
View File
@@ -0,0 +1,37 @@
services:
backend:
build:
context: .
dockerfile: web/backend/Dockerfile
volumes:
# Bind mount for source code (hot-reload for Python)
- ./web/backend:/app/backend
- ./audio_splitter:/app/audio_splitter
- ./setup.py:/app/setup.py
- ./pyproject.toml:/app/pyproject.toml
# Development data directory (overrides production)
- "./dev_data:/tmp/audio_splitter_web"
environment:
- DEBUG=1
- PYTHONUNBUFFERED=1
ports:
- "8000:8000"
frontend:
build:
context: ./web/frontend
# Use the same Dockerfile, but override CMD for development
dockerfile: Dockerfile
command: ["npm", "run", "dev", "--", "--host", "0.0.0.0"]
volumes:
# Bind mount for source code (hot-reload for Vite)
- ./web/frontend:/app
- node_modules:/app/node_modules
environment:
- BACKEND_URL=http://backend:8000
- VITE_BACKEND_URL=http://backend:8000
ports:
- "5173:5173"
volumes:
node_modules:
+8 -16
View File
@@ -1,29 +1,21 @@
services:
backend:
build:
context: .
dockerfile: web/backend/Dockerfile
image: git.vmn.su/max/audio_splitter_backend:latest
ports:
- "8000:8000"
- "${BACKEND_PORT:-8000}:8000"
volumes:
- /tmp/audio_splitter_web:/tmp/audio_splitter_web # Bind mount
# Bind mount for persistent data storage.
# Set BACKEND_DATA_DIR in .env to point to your data directory.
- "${BACKEND_DATA_DIR:-/var/lib/audio_splitter_data}:/tmp/audio_splitter_web"
environment:
- PYTHONUNBUFFERED=1
- DEBUG=1
- DEBUG=${DEBUG:-0}
restart: unless-stopped
frontend:
build:
context: ./web/frontend
dockerfile: Dockerfile
image: git.vmn.su/max/audio_splitter_frontend:latest
ports:
- "5173:80"
volumes:
- ./web/frontend:/app
- /app/node_modules
environment:
- BACKEND_URL=http://backend:8000
- VITE_BACKEND_URL=http://backend:8000
- "${FRONTEND_PORT:-5173}:80"
depends_on:
- backend
restart: unless-stopped