feat(deploy): improve environment variable handling and deployment workflow
Some checks failed
Deploy website on production server when committing on main / test (push) Failing after 12s

- Update .vars to properly export deployment configuration variables
- Modify deploy.sh to conditionally source .vars only in interactive mode
- Remove include directive from makefile to prevent automatic variable loading
- Enhance deployment script reliability by ensuring proper environment setup
This commit is contained in:
2026-02-01 19:24:37 +01:00
parent 83728057ee
commit 2f2c60126c
3 changed files with 6 additions and 3 deletions

4
.vars
View File

@@ -1,4 +1,4 @@
#/usr/bin/env bash
"${DEPLOYMENT_HOST:=docker.infra.bjphoster.cloud}"
"${DEPLOYMENT_PATH:=/opt/pedini.dev}"
export DEPLOYMENT_HOST=docker.infra.bjphoster.cloud
export DEPLOYMENT_PATH=/opt/pedini.dev

View File

@@ -12,6 +12,10 @@ set -e
# then remove everything in the data path, untar the tarball and reload the server
# finally remove the tarball, both from the remote host and locally (cleanup)
if [ -t 0 ]; then # Interactive: prompt user
source .vars
fi
# Check if the username variable is set
if [ ! -z "${SSH_USERNAME}" ]; then
SSH_USERNAME="${SSH_USERNAME}@"

View File

@@ -1,5 +1,4 @@
#!make
include .vars
default: build