Update server.ts #3
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 Push to Docker Hub | |
| on: | |
| push: | |
| paths: | |
| - 'backend/**' | |
| - 'connectify/**' | |
| jobs: | |
| Building_Frontend-Backend: | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: React Build | |
| run: | | |
| cd connectify | |
| npm install | |
| npm run build | |
| - name: Upload Frontend Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-build | |
| path: connectify/dist | |
| Building_Docker_Image: | |
| runs-on: ubuntu-latest | |
| needs: Building_Frontend-Backend | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download Frontend Build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: frontend-build | |
| path: connectify/dist | |
| - name: Building Image | |
| run: docker build -t shubhamdockr/connectify:latest . | |
| - name: Save Docker image | |
| run: docker save -o image.tar shubhamdockr/connectify:latest | |
| - name: Upload image | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: docker-image | |
| path: image.tar | |
| Pushing_Docker_Image: | |
| runs-on: ubuntu-latest | |
| needs: Building_Docker_Image | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Download image | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: docker-image | |
| - name: Load image | |
| run: docker load -i image.tar | |
| - name: Pushing Image | |
| run: | | |
| echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u shubhamdockr --password-stdin | |
| docker push shubhamdockr/connectify:latest | |
| WebHook: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: production | |
| url: https://connectify.devshubh.live | |
| needs: Pushing_Docker_Image | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Curl request | |
| run: curl -X GET "${{ secrets.WEBHOOK }}" |