Patch ssh handling for authentication.

This commit is contained in:
Christbru 2025-10-18 20:03:27 -05:00
commit f730609f62
2 changed files with 30 additions and 3 deletions

View file

@ -39,6 +39,8 @@ jobs:
context: ./web-app
push: true
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/web-app:${{ github.sha }}
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Build and push Rust engine image ⚙️
uses: docker/build-push-action@v6
@ -46,13 +48,31 @@ jobs:
context: ./rust-engine
push: true
tags: ghcr.io/${{ steps.repo_name.outputs.name }}/rust-engine:${{ github.sha }}
build-args: |
RUSTUP_TOOLCHAIN=stable
cache-from: type=gha
cache-to: type=gha,mode=max
- name: Prepare SSH key
shell: bash
run: |
mkdir -p ~/.ssh
chmod 700 ~/.ssh
# Write private key
printf "%s" "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_rsa
chmod 600 ~/.ssh/id_rsa
# Pre-populate known_hosts to avoid interactive prompt
ssh-keyscan -H "${{ secrets.SERVER_HOST }}" >> ~/.ssh/known_hosts || true
chmod 644 ~/.ssh/known_hosts
- name: Deploy to server via SSH ☁️
uses: appleboy/ssh-action@v1.0.3
with:
host: ${{ secrets.SERVER_HOST }}
username: ${{ secrets.SERVER_USERNAME }}
key: ${{ secrets.SSH_PRIVATE_KEY }}
key_path: ~/.ssh/id_rsa
debug: true
script: |
cd /var/www/codered-astra
export GEMINI_API_KEY='${{ secrets.GEMINI_API_KEY }}'