-
Notifications
You must be signed in to change notification settings - Fork 2
46 lines (36 loc) · 1.17 KB
/
deploy.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
name: Deploy backend to GCP
on:
push:
branches:
- main
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
- name: Build with Maven
run: mvn -B -f backend/pom.xml package
- 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
run: gcloud auth configure-docker
- name: Build Docker image
run: |
docker build --build-arg GOOGLE_FILE_PASSWORD=${{ secrets.GOOGLE_FILE_PASSWORD }} -t gcr.io/brief-me-backend/brief-me-backend:1.0 .
docker push gcr.io/brief-me-backend/brief-me-backend:1.0
- name: Deploy to GCP
run: |
gcloud run deploy brief-me-backend-app --image gcr.io/brief-me-backend/brief-me-backend:1.0 --platform managed
env:
GOOGLE_APPLICATION_CREDENTIALS: ${{ secrets.GCP_SA_KEY }}