name: Deploy to Ubuntu Server on: push: branches: - main jobs: deploy: runs-on: ubuntu-latest steps: - name: Setup SSH key uses: webfactory/ssh-agent@v0.9.0 with: ssh-private-key: ${{ secrets.NAS_SSH_KEY_ADMIN }} - name: Deploy via SSH env: HOST: ${{ secrets.NAS_HOST }} PORT: ${{ secrets.NAS_PORT }} USER: ${{ secrets.NAS_USER }} run: | ssh -o StrictHostKeyChecking=no -p $PORT $USER@$HOST << 'EOF' mkdir -p ~/robeing-nginx if [ -d "~/robeing-nginx/.git" ]; then cd ~/robeing-nginx && git pull origin main else git clone https://github.com/ivada-Robeing/nginx-deploy.git ~/robeing-nginx cd ~/robeing-nginx fi mkdir -p ssl certbot-webroot docker-compose down || true docker-compose up -d EOF