Server: add check on user folder existance on every api call #33
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: Build & Deploy bifrost-server | |
| on: | |
| push: | |
| branches: | |
| - main | |
| paths: | |
| - "server/**" | |
| pull_request: | |
| branches: | |
| - main | |
| paths: | |
| - "server/**" | |
| workflow_dispatch: | |
| jobs: | |
| build-and-deploy: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v3 | |
| - name: Deploy via SSH | |
| uses: appleboy/ssh-action@v1.2.2 | |
| with: | |
| host: ${{ secrets.SSH_HOST }} | |
| username: ${{ secrets.SSH_USERNAME }} | |
| key: ${{ secrets.SSH_PRIVATE_KEY }} | |
| script: | | |
| set -e | |
| cd ${{ secrets.DEPLOY_DIRECTORY }} | |
| echo "::group::Pulling latest changes" | |
| git pull origin main | |
| echo "::endgroup::" | |
| cd server | |
| echo "::group::Removing dist folder" | |
| rm -rf dist | |
| echo "::endgroup::" | |
| echo "::group::Installing dependencies" | |
| npm install | |
| echo "::endgroup::" | |
| echo "::group::Building project" | |
| npm run build | |
| echo "::endgroup::" | |
| echo "::group::Copying .env file" | |
| cp .env dist/ | |
| echo "::endgroup::" | |
| echo "::group::Restarting bifrost.service" | |
| sudo systemctl restart bifrost.service | |
| echo "::endgroup::" |