diff --git a/.gitea/workflows/build.yaml b/.gitea/workflows/build.yaml index fc1bbff..0871fee 100644 --- a/.gitea/workflows/build.yaml +++ b/.gitea/workflows/build.yaml @@ -31,4 +31,20 @@ jobs: path: ./dist # On regarde si les fichiers sont là - name: List files - run: ls -l ./dist \ No newline at end of file + run: ls -l ./dist + # On installe Rsync + - name: Install Rsync + run: sudo apt-get install rsync -y + # On ajoute la clé SSH + - name: Add SSH key + run: echo "$DEPLOY_KEY" > $HOME/.ssh/test_private_key && chmod 600 $HOME/.ssh/test_private_key + # On utilise Rsync pour copier les fichiers (On fait en sorte de supprimer les ancien fichiers) + - name: Deploy files + run: rsync -av -e "ssh -i $HOME/.ssh/test_private_key" --delete ./dist/ $DEPLOY_URL + # On supprime la clé SSH + - name: Remove SSH key + run: rm $HOME/.ssh/test_private_key + + variables: + DEPLOY_URL: ${{ secrets.DEPLOY_URL }} + DEPLOY_KEY: ${{ secrets.DEPLOY_KEY }}