graphiti/.github/workflows/release-service-image.yml
Pavlo Paliychuk 50f9418a30
chore: Add build and start CI workflow (#164)
* chore: Add build and start CI workflow

* chore: Fix docker-compose command

* chore: Fix healthcheck port

* fix: test docker compose setup

* chore: Simulate container start error

* chore: Always log service logs

* revert dev version changes, and simulate error in the healthcheck

* chore: Log docker logs only on failure, revert simulated error

* chore: Make release workflows depend on build and start workflow
2024-10-01 10:25:12 -04:00

56 lines
1.5 KiB
YAML

name: Build image
on:
push:
# Publish semver tags as releases.
tags: [ 'v*.*.*' ]
env:
REGISTRY: docker.io
IMAGE_NAME: zepai/graphiti
jobs:
docker-image:
needs: build-and-start-svc
environment:
name: release
runs-on: ubuntu-latest
permissions:
contents: read
id-token: write
steps:
- name: Checkout repo for tag push
uses: actions/checkout@v4
with:
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Set up Depot CLI
uses: depot/setup-action@v1
- name: Login to DockerHub
uses: docker/login-action@v2
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Extract Docker metadata
id: meta
uses: docker/metadata-action@v4.4.0
with:
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
tags: |
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=match,pattern=v(.*-beta),group=1
type=match,pattern=v.*-(beta),group=1
- name: Depot build and push image
uses: depot/build-push-action@v1
with:
context: .
platforms: linux/amd64,linux/arm64
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.meta.outputs.tags || env.TAGS }}
labels: ${{ steps.meta.outputs.labels }}
cache-from: type=gha
cache-to: type=gha,mode=max