chore(backend): fix Go version in Dockerfile, add render.yaml #38
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: prod-ci-superplane | |
| on: | |
| push: | |
| branches: | |
| - main | |
| permissions: | |
| contents: read | |
| env: | |
| BACKEND_IMAGE: chitsetu-backend | |
| FRONTEND_IMAGE: chitsetu-frontend | |
| ML_IMAGE: chitsetu-ml | |
| WEB3_IMAGE: chitsetu-web3 | |
| jobs: | |
| ci-build-push-notify: | |
| runs-on: ubuntu-latest | |
| environment: Chitsetu secrets | |
| steps: | |
| - name: Checkout | |
| uses: actions/checkout@v4 | |
| - name: Setup Go | |
| uses: actions/setup-go@v5 | |
| with: | |
| go-version-file: services/backend/go.mod | |
| - name: Backend checks | |
| working-directory: services/backend | |
| run: | | |
| go test ./... | |
| go build ./... | |
| - name: Setup Node | |
| uses: actions/setup-node@v4 | |
| with: | |
| node-version: 20 | |
| cache: npm | |
| cache-dependency-path: services/frontend/package-lock.json | |
| - name: Frontend checks | |
| working-directory: services/frontend | |
| run: | | |
| npm ci | |
| npm run lint --if-present | |
| - name: Setup Python | |
| uses: actions/setup-python@v5 | |
| with: | |
| python-version: "3.11" | |
| - name: ML checks | |
| working-directory: services/ml-service | |
| run: | | |
| python -m pip install --upgrade pip | |
| pip install -r requirements.txt | |
| python -m compileall app | |
| - name: Set image namespace | |
| shell: bash | |
| run: | | |
| if [ -n "${{ secrets.DOCKERHUB_NAMESPACE }}" ]; then | |
| echo "IMAGE_NAMESPACE=${{ secrets.DOCKERHUB_NAMESPACE }}" >> "$GITHUB_ENV" | |
| else | |
| echo "IMAGE_NAMESPACE=${{ secrets.DOCKERHUB_USERNAME }}" >> "$GITHUB_ENV" | |
| fi | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ secrets.DOCKERHUB_USERNAME }} | |
| password: ${{ secrets.DOCKERHUB_TOKEN }} | |
| - name: Build and push backend image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: services/backend | |
| file: services/backend/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.BACKEND_IMAGE }}:latest | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }} | |
| - name: Build and push frontend image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: services/frontend | |
| file: services/frontend/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.FRONTEND_IMAGE }}:latest | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }} | |
| - name: Build and push ml image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: services/ml-service | |
| file: services/ml-service/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.ML_IMAGE }}:latest | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.ML_IMAGE }}:${{ github.sha }} | |
| - name: Build and push web3 image | |
| uses: docker/build-push-action@v6 | |
| with: | |
| context: services/web3 | |
| file: services/web3/Dockerfile | |
| push: true | |
| tags: | | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.WEB3_IMAGE }}:latest | |
| ${{ env.IMAGE_NAMESPACE }}/${{ env.WEB3_IMAGE }}:${{ github.sha }} | |
| - name: Trigger SuperPlane webhook | |
| shell: bash | |
| env: | |
| SUPERPLANE_WEBHOOK_URL: ${{ secrets.SUPERPLANE_WEBHOOK_URL }} | |
| SUPERPLANE_TOKEN: ${{ secrets.SUPERPLANE_TOKEN }} | |
| run: | | |
| payload=$(cat <<JSON | |
| { | |
| "event": "build.success", | |
| "sha": "${{ github.sha }}", | |
| "branch": "${{ github.ref_name }}", | |
| "actor": "${{ github.actor }}", | |
| "repo": "${{ github.repository }}", | |
| "images": { | |
| "backend": "${{ env.IMAGE_NAMESPACE }}/${{ env.BACKEND_IMAGE }}:${{ github.sha }}", | |
| "frontend": "${{ env.IMAGE_NAMESPACE }}/${{ env.FRONTEND_IMAGE }}:${{ github.sha }}", | |
| "ml": "${{ env.IMAGE_NAMESPACE }}/${{ env.ML_IMAGE }}:${{ github.sha }}", | |
| "web3": "${{ env.IMAGE_NAMESPACE }}/${{ env.WEB3_IMAGE }}:${{ github.sha }}" | |
| } | |
| } | |
| JSON | |
| ) | |
| curl -X POST "$SUPERPLANE_WEBHOOK_URL" \ | |
| -H "Authorization: Bearer $SUPERPLANE_TOKEN" \ | |
| -H "Content-Type: application/json" \ | |
| -d "$payload" |