Feat/423-review-limit-and-request-status #51
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: Jobboard Backend Test Deployment (PR) | |
| on: | |
| pull_request: | |
| branches: | |
| - dev | |
| paths: | |
| - "apps/jobboard-backend/**" | |
| - ".github/workflows/backend-deploy-test.yml" | |
| concurrency: | |
| group: backend-deploy-test | |
| cancel-in-progress: true | |
| jobs: | |
| build-and-deploy: | |
| name: Build and Deploy to Cloud Run | |
| runs-on: ubuntu-latest | |
| steps: | |
| - name: Checkout repository | |
| uses: actions/checkout@v5 | |
| - name: Authenticate to Google Cloud | |
| uses: google-github-actions/auth@v3 | |
| with: | |
| credentials_json: ${{ secrets.GCP_SA_KEY }} | |
| - name: Set up Cloud SDK | |
| uses: google-github-actions/setup-gcloud@v3 | |
| - name: Configure Docker authentication for Artifact Registry | |
| run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet --project ${{ env.PROJECT_ID }} | |
| - name: Build and push Docker image to Artifact Registry | |
| run: | | |
| set -e | |
| IMAGE="${{ env.REGION }}-docker.pkg.dev/${{ env.PROJECT_ID }}/${{ env.REPO_NAME }}/jobboard-backend:test-${{ github.sha }}" | |
| docker build -t "$IMAGE" ./apps/jobboard-backend | |
| docker push "$IMAGE" | |
| echo "IMAGE=$IMAGE" >> $GITHUB_ENV | |
| - name: Deploy to Cloud Run test environment | |
| run: | | |
| set -e | |
| gcloud run deploy jobboard-backend-test \ | |
| --image "${{ env.IMAGE }}" \ | |
| --region ${{ env.REGION }} \ | |
| --project ${{ env.PROJECT_ID }} \ | |
| --service-account jobboard-runtime@${{ env.PROJECT_ID }}.iam.gserviceaccount.com \ | |
| --allow-unauthenticated \ | |
| --port 8080 \ | |
| --memory 512Mi \ | |
| --cpu 1 \ | |
| --min-instances 0 \ | |
| --max-instances 1 \ | |
| --concurrency 80 \ | |
| --set-env-vars "APP_ENV=test" \ | |
| --set-env-vars "SPRING_DATASOURCE_URL=jdbc:postgresql://ep-lucky-brook-ag2dzxqz-pooler.c-2.eu-central-1.aws.neon.tech:5432/jobboard?sslmode=require" \ | |
| --set-env-vars "SPRING_DATASOURCE_USERNAME=jobboard_owner" \ | |
| --set-env-vars "APP_VERIFY_EMAIL_URL=https://bounswe-jobboard-test.pages.dev/verify-email" \ | |
| --set-env-vars "APP_RESET_PASSWORD_URL=https://bounswe-jobboard-test.pages.dev/reset-password" \ | |
| --set-env-vars "APP_CORS_ALLOWED_ORIGINS=https://bounswe-jobboard-test.pages.dev" \ | |
| --set-env-vars "MAIL_USERNAME=apikey" \ | |
| --set-env-vars "APP_GCS_BUCKET=bounswe-jobboard" \ | |
| --set-env-vars "[email protected]" \ | |
| --set-secrets "SPRING_DATASOURCE_PASSWORD=jobboard-neon-db-pass:latest" \ | |
| --set-secrets "APP_JWT_SECRET=jobboard-jwt-secret-test:latest" \ | |
| --set-secrets "MAIL_PASSWORD=jobboard-mail-password:latest" | |
| env: | |
| PROJECT_ID: shadowops-dev | |
| REGION: europe-west1 | |
| REPO_NAME: jobboard-containers |