Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions .github/workflows/cd.yml
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,13 @@ jobs:
cd "$DEPLOY_PATH"
ENV_FILE="./deploy/env/backend.env"

# Keep VM source scripts in sync with latest main before running any local script.
if [ -d .git ]; then
git fetch origin
git checkout main
git pull --ff-only origin main
fi
Comment on lines +177 to +182
Copy link

Copilot AI Mar 28, 2026

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This block force-checks out main on the VM even when the workflow is triggered by a release tag (startsWith(github.ref, 'refs/tags/v')). That means tag deployments will always run the latest main docker-compose.prod.yml / deploy/scripts rather than the scripts corresponding to the tagged commit, which can cause version mismatches (e.g., compose/service name or script expectation drift relative to the images being deployed).

If tag deploys should be reproducible, pass the desired ref (e.g., github.ref_name/github.sha) into the SSH step and check out that ref on the VM, or gate this sync block to only run on refs/heads/main deployments.

Copilot uses AI. Check for mistakes.

if [ ! -f "$ENV_FILE" ]; then
echo "Missing required file: $ENV_FILE"
exit 1
Expand Down
Loading