-
Notifications
You must be signed in to change notification settings - Fork 0
45 lines (36 loc) · 1.49 KB
/
deploy-frontend.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
name: Build and deploy to GCP
on:
push:
branches:
- habib
workflow_dispatch:
jobs:
build:
runs-on: ubuntu-latest
env:
#42-canine-frontend/42-canine-frontend can be anything but the last part shall be same as service for Update Cloud Run service
IMAGE_URL: ${{ secrets.GCP_REGION }}-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID}}/cloud-run-source-deploy/wander-wise/wander-wise:${{ github.sha }}
#the last part is service name
steps:
- uses: actions/checkout@v3
- id: "auth"
name: Authenticate GCP
uses: google-github-actions/auth@v1
with:
credentials_json: "${{ secrets.GCLOUD_SERVICE_KEY }}"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- name: Use gcloud CLI
run: gcloud info
- name: Configure docker
run: gcloud auth configure-docker europe-north1-docker.pkg.dev
- name: Docker Build
run: docker build --no-cache -t ${{ env.IMAGE_URL }} ./frontend -f ./frontend/Dockerfile
- name: Docker Push
run: docker push $IMAGE_URL
- name: Update Cloud Run service
uses: google-github-actions/deploy-cloudrun@v1
with:
region: ${{ secrets.GCP_REGION}}
service: wander-wise-frontend
image: ${{ env.IMAGE_URL }}