fix: response sendMessage #53
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: Deploy Potpie Service to Lightsail Kubernetes | |
| on: | |
| push: | |
| branches: [ main, master ] | |
| workflow_dispatch: | |
| env: | |
| DOCKER_EMAIL: digital@pixdata.io | |
| DOCKER_USERNAME: pagewings | |
| IMAGE_NAME: coderide-potpie-service | |
| REGISTRY: docker.io | |
| jobs: | |
| build-and-deploy: | |
| environment: master | |
| runs-on: ubuntu-latest | |
| if: github.ref == 'refs/heads/main' || github.ref == 'refs/heads/master' | |
| name: Build, Push and Deploy Docker Image | |
| steps: | |
| # 1️⃣ Checkout codice | |
| - name: Checkout code | |
| uses: actions/checkout@v4 | |
| # 2️⃣ Setup Docker Buildx | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| # 3️⃣ Login a Docker Hub | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v3 | |
| with: | |
| username: ${{ env.DOCKER_EMAIL }} | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| # 4️⃣ Crea variabile con lo short SHA (tag univoco) | |
| - name: Extract short commit SHA | |
| id: vars | |
| run: echo "SHA=$(echo $GITHUB_SHA | cut -c1-7)" >> $GITHUB_ENV | |
| # 5️⃣ Build e push dell'immagine su Docker Hub | |
| - name: Build and push Docker image | |
| uses: docker/build-push-action@v5 | |
| with: | |
| context: . | |
| push: true | |
| tags: | | |
| ${{ env.REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:latest | |
| ${{ env.REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.SHA }} | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| # 6️⃣ Setup kubectl per accedere al cluster K3s | |
| - name: Setup kubectl | |
| uses: azure/setup-kubectl@v3 | |
| with: | |
| version: 'latest' | |
| - name: Configure kubectl | |
| run: | | |
| mkdir -p ~/.kube | |
| echo "${{ secrets.KUBE_CONFIG }}" | base64 -d > ~/.kube/config | |
| chmod 600 ~/.kube/config | |
| # 7️⃣ Aggiorna l'immagine nel Deployment di Kubernetes | |
| - name: Update image in Kubernetes | |
| run: | | |
| kubectl set image deployment/potpie-service potpie-service=${{ env.REGISTRY }}/${{ env.DOCKER_USERNAME }}/${{ env.IMAGE_NAME }}:${{ env.SHA }} --namespace=default | |
| kubectl rollout status deployment/potpie-service --namespace=default | |
| kubectl get pods -l app=potpie-service --namespace=default |