this repo has no description

Trying a different approach for deploying the thing

astrra.space d440f1c4 96575310

verified
Changed files
+18 -10
.forgejo
workflows
+18 -10
.forgejo/workflows/deploy.yaml
··· 29 29 - name: Build project 30 30 run: deno task build 31 31 32 - - name: Setup SCP 32 + - name: Setup SSH 33 33 run: | 34 34 mkdir -p ~/.ssh 35 35 echo "${{ secrets.SSH_PRIVATE_KEY }}" > ~/.ssh/id_ed25519 36 - chmod -R go-rwx ~/.ssh 36 + chmod 600 ~/.ssh/id_ed25519 37 + cat > ~/.ssh/config << EOF 38 + Host deploy 39 + HostName ${{ vars.SERVER_HOST }} 40 + User ${{ vars.SERVER_USER }} 41 + IdentityFile ~/.ssh/id_ed25519 42 + StrictHostKeyChecking accept-new 43 + BatchMode yes 44 + PasswordAuthentication no 45 + PubkeyAuthentication yes 46 + EOF 47 + chmod 600 ~/.ssh/config 37 48 ssh-keyscan -H ${{ vars.SERVER_HOST }} >> ~/.ssh/known_hosts 38 - echo "Deploying to ${{ vars.SERVER_HOST }} as ${{ vars.SERVER_USER }} to /home/common/www/${{ github.ref_name }}" 49 + echo "Deploying to ${{ vars.SERVER_HOST }} as ${{ vars.SERVER_USER }} to /var/www/pds/${{ github.ref_name }}" 39 50 40 51 - name: Debug SSH Connection 41 - run: ssh -v -o PasswordAuthentication=no -i ~/.ssh/id_ed25519 ${{ vars.SERVER_USER }}@${{ vars.SERVER_HOST }} echo "SSH Connection Successful" 52 + run: ssh -v deploy echo "SSH Connection Successful" 42 53 43 - - name: create folder if not exists 44 - run: | 45 - ssh -i ~/.ssh/id_ed25519 ${{ vars.SERVER_USER }}@${{ vars.SERVER_HOST }} "mkdir -p /var/www/pds/${{ github.ref_name }}" 54 + - name: Create folder if not exists 55 + run: ssh deploy "mkdir -p /var/www/pds/${{ github.ref_name }}" 46 56 47 57 - name: Deploy via SCP 48 - run: | 49 - scp -i ~/.ssh/id_ed25519 -rv ./dist/* ${{ vars.SERVER_USER }}@\[${{ vars.SERVER_HOST }}\]:/var/www/pds/${{ github.ref_name }} 50 - 58 + run: scp -r ./dist/* deploy:/var/www/pds/${{ github.ref_name }}