Merge pull request #764 from mohyware/fix/remove-hardcoded-slit #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: 🏓 backend-cd | |
| on: | |
| push: | |
| branches: | |
| - main | |
| # on: | |
| # push: | |
| # branches: | |
| # - main | |
| # pull_request: | |
| # branches: | |
| # - main | |
| defaults: | |
| run: | |
| working-directory: ./backend | |
| jobs: | |
| backend-deploy: | |
| name: 🚀 Deploy backend to production | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Check out Git repository | |
| uses: actions/checkout@v3 | |
| - name: Login to Docker Hub | |
| uses: docker/login-action@v2 | |
| with: | |
| username: arunavabasu03 | |
| password: ${{ secrets.DOCKER_PASSWORD }} | |
| - name: Login to GCP | |
| uses: "google-github-actions/auth@v2" | |
| with: | |
| project_id: ${{ secrets.PROJECT_ID }} | |
| credentials_json: "${{ secrets.CLOUD_RUN_SERVICE_ACCOUNT }}" | |
| - name: Set up Docker Buildx | |
| uses: docker/setup-buildx-action@v3 | |
| - name: Set up Cloud SDK | |
| uses: "google-github-actions/setup-gcloud@v2" | |
| - name: Build Tag and Push Docker image | |
| uses: docker/build-push-action@v4 | |
| with: | |
| context: backend | |
| tags: "arunavabasu03/radisapp_backend:latest" | |
| push: true | |
| cache-from: type=gha | |
| cache-to: type=gha,mode=max | |
| - name: Deploy to cloud run | |
| uses: 'google-github-actions/deploy-cloudrun@v2' | |
| with: | |
| service: radisapp-backend | |
| image: ${{ secrets.CONTAINER_NAME }} | |
| env_vars: | | |
| # Google/Infra Vars | |
| LOGTAIL_SOURCE_TOKEN=${{ secrets.LOGTAIL_SOURCE_TOKEN }} | |
| LOGTAIL_HOST=${{ secrets.LOGTAIL_HOST }} | |
| # HITRAN Vars | |
| HITRAN_EMAIL=${{ secrets.HITRAN_EMAIL }} | |
| HITRAN_PASSWORD=${{ secrets.HITRAN_PASSWORD }} |