-
-
Notifications
You must be signed in to change notification settings - Fork 21
89 lines (65 loc) · 2.58 KB
/
publish.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
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
on: [push]
jobs:
build-api:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- id: get_branch
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- id: set_image_name
run: echo "IMAGE_NAME=us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/api/${BRANCH}" >> $GITHUB_ENV
- name: Build Docker Image
run: docker build -t $IMAGE_NAME:$GITHUB_SHA -f api.Dockerfile .
- name: Push Docker Image to Google Artifact Registry
run: |
gcloud auth configure-docker us-east1-docker.pkg.dev
docker push $IMAGE_NAME:$GITHUB_SHA
build-chat:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- id: get_branch
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- id: set_image_name
run: echo "IMAGE_NAME=us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/chat/${BRANCH}" >> $GITHUB_ENV
- name: Build Docker Image
run: docker build -t $IMAGE_NAME:$GITHUB_SHA -f chat.Dockerfile .
- name: Push Docker Image to Google Artifact Registry
run: |
gcloud auth configure-docker us-east1-docker.pkg.dev
docker push $IMAGE_NAME:$GITHUB_SHA
build-cron:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@v3
- id: 'auth'
uses: 'google-github-actions/auth@v1'
with:
credentials_json: '${{ secrets.GCP_CREDENTIALS }}'
- name: Setup Google Cloud SDK
uses: google-github-actions/setup-gcloud@v1
- id: get_branch
run: echo "BRANCH=${GITHUB_REF#refs/heads/}" >> $GITHUB_ENV
- id: set_image_name
run: echo "IMAGE_NAME=us-east1-docker.pkg.dev/${{ secrets.GCP_PROJECT_ID }}/cron/${BRANCH}" >> $GITHUB_ENV
- name: Build Docker Image
run: docker build -t $IMAGE_NAME:$GITHUB_SHA -f cron.Dockerfile .
- name: Push Docker Image to Google Artifact Registry
run: |
gcloud auth configure-docker us-east1-docker.pkg.dev
docker push $IMAGE_NAME:$GITHUB_SHA