chore: add example env files #8
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 VPS | |
on: | |
workflow_dispatch: | |
push: | |
branches: [ main ] | |
jobs: | |
sonar: | |
name: SonarQube | |
runs-on: ubuntu-latest | |
steps: | |
- uses: actions/checkout@v3 | |
with: | |
fetch-depth: 0 | |
- name: SonarQube Scan | |
uses: sonarsource/sonarqube-scan-action@master | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
SONAR_HOST_URL: ${{ secrets.SONAR_HOST_URL }} | |
- name: SonarQube Quality Gate | |
uses: sonarsource/sonarqube-quality-gate-action@master | |
timeout-minutes: 5 | |
env: | |
SONAR_TOKEN: ${{ secrets.SONAR_TOKEN }} | |
deploy: | |
runs-on: ubuntu-latest | |
needs: sonar | |
steps: | |
- name: Deploy using ssh | |
uses: appleboy/ssh-action@master | |
with: | |
host: ${{ secrets.VPS_HOST }} | |
username: ${{ secrets.VPS_USERNAME }} | |
key: ${{ secrets.VPS_PRIVATE_KEY }} | |
port: ${{ secrets.VPS_PORT }} | |
script: | | |
cd ~/nuchat | |
git pull --rebase origin main | |
export NVM_DIR=~/.nvm | |
source ~/.nvm/nvm.sh | |
npm ci | |
npm run prod |