Skip to content
This repository was archived by the owner on Nov 1, 2025. It is now read-only.

docker

docker #3

name: Docker inkeep/agents-run-api
on:
push:
branches: [main]
jobs:
build-and-push:
name: Build and Push
runs-on: ubuntu-latest
steps:
# 1. Checkout source code
- name: Checkout source code
uses: actions/checkout@v4
with:
fetch-depth: 0 # Fetches full history for better caching/context
# 2. Set up Docker Buildx
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
# 3. Cache Docker layers
- name: Cache Docker layers
uses: actions/cache@v4
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: ${{ runner.os }}-buildx-
# 4. Extract metadata
- name: Extract metadata
id: meta
run: |
echo "REPO_NAME=${GITHUB_REPOSITORY##*/}" >> "$GITHUB_OUTPUT"
echo "SHORT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_OUTPUT"
# 5. Login to Docker Hub
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
# 6. Build and push image
- name: Build and push production image
uses: docker/build-push-action@v6
with:
context: .
file: Dockerfile.run-api
push: true
platforms: linux/amd64,linux/arm64
tags: |
inkeep/agents-run-api:latest
inkeep/agents-run-api:${{ steps.meta.outputs.SHORT_SHA }}
cache-from: type=gha
cache-to: type=gha,mode=max