-
Notifications
You must be signed in to change notification settings - Fork 0
49 lines (39 loc) · 1.3 KB
/
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
name: cd
on:
push:
branches: [main]
jobs:
deploy:
name: deploy
runs-on: ubuntu-latest
steps:
- name: Check out code
uses: actions/checkout@v4
- name: Set up Go
uses: actions/setup-go@v5
with:
go-version: "1.22"
- name: Build app
run: ./scripts/buildprod.sh
- id: "auth"
uses: "google-github-actions/auth@v2"
with:
credentials_json: "${{ secrets.GCP_CREDENTIALS }}"
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v2
- name: Build & Push Docker Image
run: "gcloud builds submit --tag us-east1-docker.pkg.dev/xoracle/xoracle-repo/xoracle:latest ."
- name: Deploy to Cloud Run
run: "gcloud run deploy xoracle --image us-east1-docker.pkg.dev/xoracle/xoracle-repo/xoracle:latest --region us-east1 --allow-unauthenticated --project xoracle --max-instances=4"
- name: Log into DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build and Push Docker Image
uses: docker/build-push-action@v5
with:
context: .
file: ./Dockerfile
push: true
tags: sutats/xoracle:latest