-
Notifications
You must be signed in to change notification settings - Fork 16
65 lines (49 loc) · 1.39 KB
/
backend_cd.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
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
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 }}