Update package.json #6
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: React Build | |
| run: | | |
| cd backend | |
| npm install | |
| npm run build | |
| - name: Upload Frontend Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: frontend-build | |
| path: connectify/dist | |
| - name: Upload Backend Build | |
| uses: actions/upload-artifact@v4 | |
| with: | |
| name: backend-build | |
| path: backend/dist | |
| Build-Push_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: Download Backend Build | |
| uses: actions/download-artifact@v4 | |
| with: | |
| name: backend-build | |
| path: backend/dist | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Docker Login | |
| run: echo "${{ secrets.DOCKERHUB_TOKEN }}" | docker login -u shubhamdockr --password-stdin | |
| - name: Build and Push Docker image with cache | |
| run: | | |
| docker buildx build \ | |
| --push \ | |
| --tag ${{ secrets.USERNAME }}/connectify:latest \ | |
| --platform linux/amd64,linux/arm64,linux/arm/v7 \ | |
| . | |
| WebHook: | |
| runs-on: ubuntu-latest | |
| environment: | |
| name: production | |
| url: https://connectify.devshubh.live | |
| needs: Build-Push_Docker_Image | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Curl request | |
| run: curl -X GET "${{ secrets.WEBHOOK }}" |