dkfjf #1
This file contains hidden or 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 Project | |
on: | |
push: | |
branches: | |
- main | |
pull_request: | |
branches: | |
- main | |
jobs: | |
deploy: | |
runs-on: ubuntu-latest | |
steps: | |
- name: Checkout code | |
uses: actions/checkout@v3 | |
- name: Set up Node.js | |
uses: actions/setup-node@v3 | |
with: | |
node-version: '22.9.0' | |
- name: Install dependencies | |
run: npm ci | |
- name: Build for production... | |
run: npm run build | |
- name: Debug HOST | |
run: echo $HOST | |
env: | |
HOST: ${{ secrets.HOST }} | |
- name: Deploy to VPS | |
env: | |
HOST: ${{ secrets.HOST }} | |
USERNAME: ${{ secrets.USERNAME }} | |
PASSWORD: ${{ secrets.PASSWORD }} | |
DEPLOYMENT_DIRECTORY: /var/www/html/requisition_api | |
run: | | |
echo "Deploying to $HOST" | |
sshpass -p "$PASSWORD" rsync -avz -e "ssh -o StrictHostKeyChecking=no" ./ "$USERNAME@$HOST:$DEPLOYMENT_DIRECTORY" |