forked from cohere-ai/cohere-toolkit
-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (51 loc) · 1.69 KB
/
docker_push_backend.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
name: Create and publish backend image
on:
release:
types: [published]
workflow_dispatch:
inputs:
tags:
description: 'Docker image tag (e.g: v0.0.1)'
required: false
type: string
env:
IMAGE_NAME: cohere-toolkit-backend
jobs:
build-and-push-backend-image:
runs-on: ubuntu-latest
permissions:
contents: read
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Authenticate with service account
uses: google-github-actions/auth@v1
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Login
uses: google-github-actions/setup-gcloud
with:
credentials_json: ${{ secrets.GCP_SA_KEY }}
- name: Set up Cloud SDK
uses: google-github-actions/setup-gcloud@v1
with:
project_id: ${{ vars.GCP_PROJECT_ID }}
export_default_credentials: true
- name: Configure Docker
run: gcloud auth configure-docker --quiet
- name: Checkout repository
uses: actions/checkout@v2
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v3
with:
images: ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}
- name: Build Docker image
run: |
docker build -t ${{ steps.meta.outputs.tags }} -f ./src/backend/Dockerfile .
- name: Tag Docker image
run: |
docker tag ${{ env.IMAGE_NAME }} ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}
# - name: Push Docker image
# run: |
# docker push ${{ vars.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ steps.meta.outputs.tags }}