Skip to content

Update and rename jekyll-gh-pages.yml to deploy-frontend.yml #40

Update and rename jekyll-gh-pages.yml to deploy-frontend.yml

Update and rename jekyll-gh-pages.yml to deploy-frontend.yml #40

Workflow file for this run

name: Deploy backend to GCP
on:
push:
branches:
- main
env:
PROJECT_ID: brief-me-backend
REGION: asia-south1
IMAGE_NAME: asia-south1-docker.pkg.dev/brief-me-backend/brief-me/brief-me-backend:1.0
jobs:
build:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- uses: actions/checkout@v3
- name: Set up JDK 17
uses: actions/setup-java@v3
with:
java-version: '17'
distribution: 'temurin'
server-id: github
- id: "auth"
name: Authenticate with GCP
uses: "google-github-actions/auth@v1"
with:
credentials_json: "${{ secrets.GCP_SA_KEY }}"
- name: 'Set up Cloud SDK'
uses: 'google-github-actions/setup-gcloud@v1'
- name: Build with Maven
run: mvn -B -f backend/pom.xml package
- name: Configure Docker Auth
run: gcloud auth configure-docker ${{ env.REGION }}-docker.pkg.dev --quiet
- name: Build Docker image
run: docker build --build-arg "GOOGLE_FILE_PASSWORD=${{ secrets.GOOGLE_FILE_PASSWORD }}" -t ${{ env.IMAGE_NAME }} .
- name: Push image
run: docker push ${{ env.IMAGE_NAME }}
- name: Deploy to GCP
run: gcloud run deploy brief-me-backend-app --image ${{ env.IMAGE_NAME }} --platform managed --region ${{ env.REGION }}
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_SA_KEY }}