fix: scp dotfile bug, remote mkdir, registry auth, SSH -T flag
This commit is contained in:
@@ -95,7 +95,7 @@ jobs:
|
||||
|
||||
# Pull from registry if configured
|
||||
if [ -n "${{ env.REGISTRY }}" ]; then
|
||||
podman pull "${{ env.REGISTRY }}/${IMAGE_NAME}:${IMAGE_TAG}"
|
||||
podman pull --tls-verify=false "${{ env.REGISTRY }}/${IMAGE_NAME}:${IMAGE_TAG}"
|
||||
podman tag "${{ env.REGISTRY }}/${IMAGE_NAME}:${IMAGE_TAG}" "${IMAGE_NAME}:${IMAGE_TAG}"
|
||||
fi
|
||||
|
||||
@@ -144,14 +144,18 @@ jobs:
|
||||
|
||||
- name: Transfer files
|
||||
run: |
|
||||
scp -r deployment/tmp/* ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/deployment/
|
||||
# Ensure remote deployment directory exists
|
||||
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} "mkdir -p ${{ secrets.DEPLOY_PATH }}/deployment"
|
||||
# Copy files explicitly — glob (*) skips dotfiles like .env.production
|
||||
scp deployment/tmp/deploy.sh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/deployment/
|
||||
scp deployment/tmp/.env.production ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/deployment/
|
||||
if [ -f image.tar ]; then
|
||||
scp image.tar ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }}/image.tar
|
||||
fi
|
||||
|
||||
- name: Deploy
|
||||
run: |
|
||||
ssh ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << ENDSSH
|
||||
ssh -T ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} << ENDSSH
|
||||
set -e
|
||||
cd ${{ secrets.DEPLOY_PATH }}
|
||||
|
||||
@@ -165,6 +169,10 @@ jobs:
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if [ -n "${{ env.REGISTRY }}" ]; then
|
||||
echo "${{ secrets.REGISTRY_PASSWORD }}" | podman login "${{ env.REGISTRY }}" -u "${{ secrets.REGISTRY_USERNAME }}" --password-stdin --tls-verify=false
|
||||
fi
|
||||
|
||||
cd deployment
|
||||
./deploy.sh
|
||||
ENDSSH
|
||||
@@ -185,4 +193,3 @@ jobs:
|
||||
|
||||
echo "✗ Health check failed"
|
||||
exit 1
|
||||
|
||||
|
||||
Reference in New Issue
Block a user