From d00ada37169ef8d907bae58f887eafa834d21fa8 Mon Sep 17 00:00:00 2001 From: marco Date: Thu, 23 Apr 2026 11:34:57 +0200 Subject: [PATCH] redid deploy.yml for change in key type --- .gitea/workflows/deploy.yml | 52 ++++++++++++++++++------------------- 1 file changed, 26 insertions(+), 26 deletions(-) diff --git a/.gitea/workflows/deploy.yml b/.gitea/workflows/deploy.yml index e270c32..8c430dc 100644 --- a/.gitea/workflows/deploy.yml +++ b/.gitea/workflows/deploy.yml @@ -2,45 +2,45 @@ name: Deploy static site on: push: - branches: - - main + branches: [main] jobs: deploy: runs-on: ubuntu-latest steps: - - name: Checkout repo + - name: Checkout uses: actions/checkout@v4 - name: Install rsync - run: | - sudo apt-get update - sudo apt-get install -y rsync + run: sudo apt-get update && sudo apt-get install -y rsync - name: Setup SSH run: | - mkdir -p ~/.ssh - echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_rsa - chmod 600 ~/.ssh/id_rsa - - ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} -t rsa ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts - - cat <> ~/.ssh/config - Host deploy - HostName ${{ secrets.DEPLOY_HOST }} - User ${{ secrets.DEPLOY_USER }} - Port ${{ secrets.DEPLOY_PORT }} - IdentityFile ~/.ssh/id_rsa - IdentitiesOnly yes - StrictHostKeyChecking yes - HostKeyAlgorithms ssh-rsa - PubkeyAcceptedAlgorithms +ssh-rsa - EOF + mkdir -p ~/.ssh + echo "${{ secrets.DEPLOY_KEY }}" > ~/.ssh/id_ed25519 + chmod 600 ~/.ssh/id_ed25519 + + ssh-keyscan -p ${{ secrets.DEPLOY_PORT }} ${{ secrets.DEPLOY_HOST }} >> ~/.ssh/known_hosts + + - name: Test SSH connection + run: | + ssh -i ~/.ssh/id_ed25519 \ + -p ${{ secrets.DEPLOY_PORT }} \ + -o StrictHostKeyChecking=yes \ + ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} \ + "echo SSH connection successful" + + - name: Ensure remote directory exists + run: | + ssh -i ~/.ssh/id_ed25519 \ + -p ${{ secrets.DEPLOY_PORT }} \ + ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }} \ + "mkdir -p ${{ secrets.DEPLOY_PATH }}" - name: Deploy via rsync run: | rsync -avz --delete \ - -e "ssh deploy" \ - index.html styles.css de/ en/ \ - deploy:${{ secrets.DEPLOY_PATH }} \ No newline at end of file + -e "ssh -i ~/.ssh/id_ed25519 -p ${{ secrets.DEPLOY_PORT }}" \ + index.html styles.css de/ en/ \ + ${{ secrets.DEPLOY_USER }}@${{ secrets.DEPLOY_HOST }}:${{ secrets.DEPLOY_PATH }} \ No newline at end of file