From c1d4544b872a90f9e9d6a5b4f283aacc371addb5 Mon Sep 17 00:00:00 2001 From: philipp Date: Sat, 17 Feb 2024 11:22:45 +0100 Subject: [PATCH] add deploy ci --- .gitea/workflows/action.yml | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) diff --git a/.gitea/workflows/action.yml b/.gitea/workflows/action.yml index 7e1ef5b..7fe7f9b 100644 --- a/.gitea/workflows/action.yml +++ b/.gitea/workflows/action.yml @@ -11,3 +11,24 @@ jobs: - name: Tests run: cargo test --verbose + + deploy-main: + runs-on: ubuntu-latest + container: git.hofer.link/ruderverein-donau-linz/rowing-ci:20240118 + if: github.ref == 'refs/heads/main' + steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Deploy + run: | + mkdir -p ~/.ssh + ssh-keyscan -H $SSH_HOST >> ~/.ssh/known_hosts + echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa + chmod 600 ~/.ssh/id_rsa + + scp ./output/* $SSH_USER@$SSH_HOST:/var/www/html/ris/ + env: + SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} + SSH_HOST: ${{ secrets.SSH_HOST }} + SSH_USER: ${{ secrets.SSH_USER }}