Building image action builds both images first, only then notifies the deployment server. Docker compose production file added
This commit is contained in:
@@ -10,7 +10,7 @@ env:
|
|||||||
REPO: audio_splitter
|
REPO: audio_splitter
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build-and-push:
|
build-and-push-backend:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout code
|
- 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:${{ github.sha }}
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_backend:latest
|
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
|
- name: Build frontend image
|
||||||
run: |
|
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:${{ github.sha }}
|
||||||
docker push ${{ env.REGISTRY }}/${{ env.OWNER }}/${{ env.REPO }}_frontend:latest
|
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"
|
||||||
|
|||||||
@@ -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
|
||||||
Reference in New Issue
Block a user