name: Deploy to App Container on: push: branches: - main jobs: build-and-deploy: runs-on: ubuntu-22.04 steps: - name: Deploy via SSH run: | ssh -o StrictHostKeyChecking=no -i /opt/gitea-runner/id_ed25519 ci@192.168.1.243 << 'EOF' APP_DIR=/home/ci/app # Remove old repo if [ -d "$APP_DIR" ]; then echo "Deleting existing repo..." rm -rf "$APP_DIR" fi # Clone latest code echo "Cloning latest code..." git clone git@192.168.1.133:3000/gibby/go-htmx-local.git "$APP_DIR" cd "$APP_DIR" # Optional: pull submodules if you use them # git submodule update --init --recursive # Stop any running containers echo "Stopping old container..." make docker-down || true # Build & start new container echo "Starting new container..." make docker-run EOF