From b6deed78c85401352dd773b4b949dad321eeca63 Mon Sep 17 00:00:00 2001 From: Maxim Vershinin Date: Tue, 4 Aug 2026 20:41:21 +0500 Subject: [PATCH] Building image action builds both images first, only then notifies the deployment server. Docker compose production file added --- .gitea/workflows/build_image.yaml | 20 +++++++++++++++----- docker-compose-prod.yaml | 25 +++++++++++++++++++++++++ 2 files changed, 40 insertions(+), 5 deletions(-) create mode 100644 docker-compose-prod.yaml diff --git a/.gitea/workflows/build_image.yaml b/.gitea/workflows/build_image.yaml index 48656fe..ecf1242 100644 --- a/.gitea/workflows/build_image.yaml +++ b/.gitea/workflows/build_image.yaml @@ -10,7 +10,7 @@ env: REPO: audio_splitter jobs: - build-and-push: + build-and-push-backend: runs-on: ubuntu-latest steps: - name: Checkout code @@ -30,10 +30,16 @@ jobs: docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:${{ github.sha }} docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest - - name: Trigger the webhook on the deployment server for backend - run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter-backend" + build-and-push-frontend: + 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: | @@ -45,5 +51,9 @@ jobs: docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:${{ github.sha }} docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest - - name: Trigger the webhook on the deployment server for frontend - run: curl "https://webhook.vmn.su/hooks/pull-audio-splitter-frontend" + + notify-deployment-server: + 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" diff --git a/docker-compose-prod.yaml b/docker-compose-prod.yaml new file mode 100644 index 0000000..9a4bc84 --- /dev/null +++ b/docker-compose-prod.yaml @@ -0,0 +1,25 @@ +services: + backend: + image: git.vmn.su/max/audio_splitter_backend:latest + ports: + - "8000:8000" + volumes: + - /tmp/audio_splitter_web:/tmp/audio_splitter_web # Bind mount + environment: + - PYTHONUNBUFFERED=1 + - DEBUG=1 + restart: unless-stopped + + frontend: + 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 + depends_on: + - backend + restart: unless-stopped