Skip to content

Cohere Chat API Integration (#204) #53

Cohere Chat API Integration (#204)

Cohere Chat API Integration (#204) #53

name: Create and publish a Docker image
on:
workflow_dispatch:
inputs:
version:
description: 'Version to tag the image with'
required: true
type: string
workflow_call:
inputs:
version:
description: 'Version to tag the image with'
required: true
type: string
push:
branches:
- 'main'
tags:
- 'v*'
jobs:
build-and-push-image:
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout repository
uses: actions/checkout@v4
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Log in to the Container registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Docker metadata
id: meta
uses: docker/metadata-action@v5
with:
images: |
ghcr.io/${{ github.repository }}
tags: |
type=ref,event=branch,enable=${{ github.event_name == 'push' }}
type=semver,pattern={{version}},enable=${{ github.event_name == 'push' }}
type=raw,value=latest,enable=${{ github.event_name != 'push' }}
type=raw,value=${{inputs.version}},enable=${{ github.event_name != 'push' }}
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
provenance: false
cache-from: type=gha
cache-to: type=gha,mode=max