diff --git a/.gitea/workflows/deploy.yaml b/.gitea/workflows/deploy.yaml index 0f581d0..d7cfe69 100644 --- a/.gitea/workflows/deploy.yaml +++ b/.gitea/workflows/deploy.yaml @@ -9,8 +9,9 @@ jobs: uses: actions/checkout@v3 - name: Install rsync run: | - apt update - apt-get install rsync -y + sudo apt-get update + sudo apt-get install rsync -y + which rsync # This will verify rsync location - name: Setup SSH env: SSH_PRIVATE_KEY: ${{ secrets.SSH_PRIVATE_KEY }} @@ -21,17 +22,16 @@ jobs: echo "$SSH_PRIVATE_KEY" > ~/.ssh/id_rsa chmod 600 ~/.ssh/id_rsa ssh-keyscan -H $HOST1 >> ~/.ssh/known_hosts - - name: Deploy to first host env: HOST1: ${{ secrets.HOST1 }} USER: ${{ secrets.USER }} run: | + # First verify the remote directory exists ssh $USER@$HOST1 'rm -rf /var/www/elia.network/html/*' - rsync -avz --delete \ + /usr/bin/rsync -avz --delete \ --exclude '.git*' \ ./ $USER@$HOST1:/var/www/elia.network/html/ - - name: Reload Nginx env: HOST1: ${{ secrets.HOST1 }}