diff --git a/.gitea/actions/deploy/action.yml b/.gitea/actions/deploy/action.yml index 9bee5a4..0595401 100644 --- a/.gitea/actions/deploy/action.yml +++ b/.gitea/actions/deploy/action.yml @@ -46,64 +46,17 @@ runs: COMPOSE_PROJECT_NAME=${{ inputs.project_name }} EOF - - name: Debug environment file + - name: Remove old Docker context shell: bash - run: | - echo "=== ENVIRONMENT FILE DEBUG ===" - echo "File path: ${{ inputs.environment_file }}" - echo "" - - # Check if file exists - if [ -f "${{ inputs.environment_file }}" ]; then - echo "✅ Environment file exists" - - # Show file size and permissions - ls -la "${{ inputs.environment_file }}" - echo "" - - # Show file contents - echo "📄 File contents:" - echo "---" - cat "${{ inputs.environment_file }}" - echo "---" - echo "" - - # Show line count - LINE_COUNT=$(wc -l < "${{ inputs.environment_file }}") - echo "📊 File has $LINE_COUNT lines" - - # Check for empty lines or whitespace issues - echo "🔍 Checking for issues:" - if grep -q "^$" "${{ inputs.environment_file }}"; then - echo "⚠️ File contains empty lines" - else - echo "✅ No empty lines found" - fi - - # Validate each variable is set - echo "🔧 Variable validation:" - while IFS='=' read -r key value; do - if [ -n "$key" ] && [ -n "$value" ]; then - echo " ✅ $key = $value" - elif [ -n "$key" ]; then - echo " ❌ $key is empty" - fi - done < "${{ inputs.environment_file }}" - - else - echo "❌ Environment file does not exist!" - fi - echo "==============================" + run: 'docker context rm deploy_target 2>/dev/null || true' - name: Create Docker context shell: bash - run: | - docker context rm deploy_target 2>/dev/null || true + run: 'docker context create deploy_target --docker "host=ssh://${{ vars.ssh_user }}@${{ vars.ssh_host }}:${{ vars.ssh_port }}"' - docker context create deploy_target \ - --docker "host=ssh://${{ vars.ssh_user }}@${{ vars.ssh_host }}:${{ vars.ssh_port }}" - - docker --context deploy_target info + - name: Validate Docker context + shell: bash + run: 'docker --context deploy_target info' - name: Stop existing deployment shell: bash