Skip to content

chore: fix build and test issues #57

chore: fix build and test issues

chore: fix build and test issues #57

name: 'Build (Cohere-Connector)'
on:
push:
branches:
- development
- production
paths:
- '.github/workflows/build-cohere-connector.yaml'
- 'gen/ts/cohere/**'
- 'package.json'
- 'services/cohere-connector/**'
- 'shared/ts/**'
env:
SERVICE_NAME: cohere-connector
FILE_PATH: ./docker/Dockerfile.ts-services
jobs:
build:
runs-on: ubuntu-latest
timeout-minutes: 15
environment: ${{ github.ref_name }}
permissions:
contents: read
id-token: write
steps:
- name: Checkout
id: checkout
uses: actions/checkout@v4
- name: Authenticate to Google Cloud
id: auth
uses: google-github-actions/auth@v2
with:
token_format: access_token
workload_identity_provider: projects/${{vars.GCP_PROJECT_NUMBER}}/locations/global/workloadIdentityPools/${{vars.GCP_WORKLOAD_IDENTITY_POOL}}/providers/${{vars.GCP_OIDC_PROVIDER_NAME}}
service_account: ${{vars.GCP_SERVICE_ACCOUNT_NAME}}@${{vars.GCP_PROJECT_ID}}.iam.gserviceaccount.com
- name: Login to Artifact Registry
uses: docker/login-action@v3
with:
registry: ${{vars.GCP_REGION}}-docker.pkg.dev
username: oauth2accesstoken
password: ${{ steps.auth.outputs.access_token }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker BuildX
uses: docker/setup-buildx-action@v3
- name: Build and Push
uses: docker/build-push-action@v5
with:
push: true
context: .
file: ${{env.FILE_PATH}}
build-args: |
BUILD_TARGET=${{env.SERVICE_NAME}}
SERVICE_NAME=${{env.SERVICE_NAME}}
tags: |
${{vars.GCP_REGION}}-docker.pkg.dev/${{vars.GCP_PROJECT_ID}}/basemind/${{env.SERVICE_NAME}}:latest
${{vars.GCP_REGION}}-docker.pkg.dev/${{vars.GCP_PROJECT_ID}}/basemind/${{env.SERVICE_NAME}}:${{github.sha}}