This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
name: Deploy to question.sh | |
on: | |
push: | |
branches: | |
- main # Adjust if necessary | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Check out repository | |
uses: actions/checkout@v3 | |
- name: Setup SSH key | |
uses: webfactory/[email protected] | |
with: | |
ssh-private-key: ${{ secrets.SSH_KEY }} | |
- name: Deploy code to VPS | |
run: | | |
# Define server connection, user, and path to the app | |
SERVER_USER="root" | |
SERVER_HOST="question.sh" | |
APP_DIR="/opt/question-sh" | |
# SSH into the VPS, pull the latest code, and restart | |
ssh -o StrictHostKeyChecking=no $SERVER_USER@$SERVER_HOST " | |
cd $APP_DIR && git pull && /root/.bun/bin/bun install && systemctl restart question-sh | |
" |