diff --git a/.github/workflows/build.yml b/.github/workflows/build.yml index 657d773..9f014cc 100644 --- a/.github/workflows/build.yml +++ b/.github/workflows/build.yml @@ -31,21 +31,26 @@ jobs: chmod 600 ~/.ssh/deploy_key ssh-keyscan -H 82.165.141.176 >> ~/.ssh/known_hosts + - name: Test SSH + run: | + ssh -i ~/.ssh/deploy_key ${{ secrets.DEPLOY_USER }}@82.165.141.176 'whoami && ls /dev/karlderheinz.tv' + - name: Copy source to server run: | rsync -avz --delete \ - --exclude node_modules --exclude .next --exclude out --exclude .git \ - ./ "${{ secrets.DEPLOY_USER }}@82.165.141.176":/var/www/vhosts/dev.karlderheinz.tv/ + -e "ssh -i $HOME/.ssh/deploy_key" \ + --exclude node_modules --exclude .next --exclude .git \ + ./ "${{ secrets.DEPLOY_USER }}@82.165.141.176":/dev/karlderheinz.tv/ - name: Install, build and restart on server run: | ssh -i ~/.ssh/deploy_key ${{ secrets.DEPLOY_USER }}@82.165.141.176 <<'EOF' set -e - cd /dev.karlderheinz.tv + cd /dev/karlderheinz.tv npm ci --no-audit --no-fund npm run build if [ -d public ]; then - cp -r public .next/standalone/public # standalone needs your static assets copied in + cp -r public .next/standalone/public fi - systemctl restart # or: monit restart + systemctl restart # or: monit restart EOF