fix: update to deploy on correct location
All checks were successful
Build and Deploy Production / build-and-push (push) Successful in 2m9s
Build and Deploy Production / deploy (push) Successful in 15s

This commit is contained in:
2025-09-06 19:20:30 +10:00
parent 2734dd8c58
commit 6cb3699016

View File

@ -47,6 +47,7 @@ jobs:
DEPLOY_USER: administrator DEPLOY_USER: administrator
DEPLOY_HOST: docker.comprofix.xyz DEPLOY_HOST: docker.comprofix.xyz
DEPLOY_PATH: /opt/comprofix DEPLOY_PATH: /opt/comprofix
VERSION: ${{ github.ref_name }} # <-- get the tag that triggered this workflow
steps: steps:
- uses: actions/checkout@v4 - uses: actions/checkout@v4
@ -65,11 +66,8 @@ jobs:
echo "Deploying production container..." echo "Deploying production container..."
ssh -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST " ssh -o StrictHostKeyChecking=no $DEPLOY_USER@$DEPLOY_HOST "
cd $DEPLOY_PATH cd $DEPLOY_PATH
# Extract Git tag that triggered the workflow # Replace IMAGE_TAG with the version from CI
VERSION=\${GITHUB_REF#refs/tags/} sed -i 's/^IMAGE_TAG=.*/IMAGE_TAG=${VERSION}/' .env.production
# Update IMAGE_TAG in .env.production
sed -i 's/^IMAGE_TAG=.*/IMAGE_TAG=\$VERSION/' .env.production
# Stop old container, pull new image, start container # Stop old container, pull new image, start container
docker compose --env-file .env.production down --remove-orphans docker compose --env-file .env.production down --remove-orphans