3 Commits

Author SHA1 Message Date
6cb3699016 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
2025-09-06 19:20:30 +10:00
2734dd8c58 fix: update to deploy on correct location
Some checks failed
Build and Deploy Production / build-and-push (push) Successful in 2m6s
Build and Deploy Production / deploy (push) Failing after 11s
2025-09-06 19:06:09 +10:00
f191fe9e4a fix: formatting so deploy runs
Some checks failed
Build and Deploy Production / build-and-push (push) Successful in 2m6s
Build and Deploy Production / deploy (push) Failing after 4s
2025-09-06 18:58:04 +10:00

View File

@ -41,12 +41,13 @@ jobs:
HUGO_BASEURL=https://comprofix.com/ HUGO_BASEURL=https://comprofix.com/
deploy: deploy:
runs-on: ubuntu-latest runs-on: homelab-latest
needs: build-and-push needs: build-and-push
env: env:
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 @@ deploy:
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