Allow all hosts in Vite server and preview config #5
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 and Deploy to Hostinger | |
| on: | |
| push: | |
| branches: [main] | |
| workflow_dispatch: | |
| env: | |
| REGISTRY: ghcr.io | |
| API_IMAGE: ghcr.io/array-ventures/claudex-api | |
| FRONTEND_IMAGE: ghcr.io/array-ventures/claudex-frontend | |
| jobs: | |
| build: | |
| runs-on: ubuntu-latest | |
| permissions: | |
| contents: read | |
| packages: write | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Log in to GitHub Container Registry | |
| uses: docker/login-action@v3 | |
| with: | |
| registry: ${{ env.REGISTRY }} | |
| username: ${{ github.actor }} | |
| password: ${{ secrets.GITHUB_TOKEN }} | |
| - name: Build and push API image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./backend | |
| push: true | |
| tags: | | |
| ${{ env.API_IMAGE }}:latest | |
| ${{ env.API_IMAGE }}:${{ github.sha }} | |
| - name: Build and push Frontend image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: ./frontend | |
| push: true | |
| tags: | | |
| ${{ env.FRONTEND_IMAGE }}:latest | |
| ${{ env.FRONTEND_IMAGE }}:${{ github.sha }} | |
| build-args: | | |
| VITE_API_BASE_URL=${{ secrets.VITE_API_BASE_URL }} | |
| VITE_WS_URL=${{ secrets.VITE_WS_URL }} | |
| deploy: | |
| needs: build | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Deploy to Hostinger VPS | |
| uses: hostinger/deploy-on-vps@v2 | |
| with: | |
| api-key: ${{ secrets.HOSTINGER_API_KEY }} | |
| virtual-machine: ${{ vars.HOSTINGER_VM_ID }} | |
| project-name: claudex | |
| docker-compose-path: docker-compose.prod.yml | |
| environment-variables: | | |
| SECRET_KEY=${{ secrets.SECRET_KEY }} | |
| POSTGRES_PASSWORD=${{ secrets.POSTGRES_PASSWORD }} | |
| VITE_WS_URL=${{ secrets.VITE_WS_URL }} | |
| LOG_LEVEL=INFO |