Update README.md
This commit is contained in:
parent
61118dda03
commit
e71f852ef2
1 changed files with 34 additions and 38 deletions
72
.github/workflows/dockerhub.yml
vendored
72
.github/workflows/dockerhub.yml
vendored
|
|
@ -1,51 +1,47 @@
|
||||||
name: build | Build and Push Docker Image to DockerHub
|
name: Build and Push Docker Image
|
||||||
|
|
||||||
on:
|
on:
|
||||||
push:
|
push
|
||||||
branches:
|
# branches:
|
||||||
- main
|
# - dev
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
docker-build-and-push:
|
docker-build-and-push:
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
steps:
|
steps:
|
||||||
- name: Checkout repository
|
- name: Checkout repository
|
||||||
uses: actions/checkout@v4
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
- name: Set up Docker Buildx
|
- name: Set up Docker Buildx
|
||||||
uses: docker/setup-buildx-action@v3
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
- name: Log in to Docker Hub
|
- name: Log in to Docker Hub
|
||||||
uses: docker/login-action@v3
|
uses: docker/login-action@v3
|
||||||
with:
|
with:
|
||||||
username: ${{ secrets.DOCKER_USERNAME }}
|
username: ${{ secrets.DOCKER_USERNAME }}
|
||||||
password: ${{ secrets.DOCKER_PASSWORD }}
|
password: ${{ secrets.DOCKER_PASSWORD }}
|
||||||
|
|
||||||
- name: Extract Git information
|
- name: Extract metadata
|
||||||
id: git-info
|
id: meta
|
||||||
run: |
|
uses: docker/metadata-action@v5
|
||||||
echo "BRANCH_NAME=${GITHUB_REF_NAME}" >> "$GITHUB_ENV"
|
with:
|
||||||
echo "COMMIT_SHA=${GITHUB_SHA::7}" >> "$GITHUB_ENV"
|
images: cognee/cognee
|
||||||
|
tags: |
|
||||||
|
type=ref,event=branch
|
||||||
|
type=sha,prefix={{branch}}-
|
||||||
|
type=raw,value=latest,enable={{is_default_branch}}
|
||||||
|
|
||||||
- name: Build and Push Docker Image
|
- name: Build and push
|
||||||
run: |
|
uses: docker/build-push-action@v5
|
||||||
IMAGE_NAME=cognee/cognee
|
with:
|
||||||
TAG_VERSION="${BRANCH_NAME}-${COMMIT_SHA}"
|
context: .
|
||||||
|
platforms: linux/amd64,linux/arm64
|
||||||
|
push: true
|
||||||
|
tags: ${{ steps.meta.outputs.tags }}
|
||||||
|
labels: ${{ steps.meta.outputs.labels }}
|
||||||
|
cache-from: type=registry,ref=cognee/cognee:buildcache
|
||||||
|
cache-to: type=registry,ref=cognee/cognee:buildcache,mode=max
|
||||||
|
|
||||||
echo "Building image: ${IMAGE_NAME}:${TAG_VERSION}"
|
- name: Image digest
|
||||||
docker buildx build \
|
run: echo ${{ steps.build.outputs.digest }}
|
||||||
--platform linux/amd64,linux/arm64 \
|
|
||||||
--push \
|
|
||||||
--tag "${IMAGE_NAME}:${TAG_VERSION}" \
|
|
||||||
--tag "${IMAGE_NAME}:latest" \
|
|
||||||
.
|
|
||||||
|
|
||||||
- name: Verify pushed Docker images
|
|
||||||
run: |
|
|
||||||
# Verify both platform variants
|
|
||||||
for PLATFORM in "linux/amd64" "linux/arm64"; do
|
|
||||||
echo "Verifying image for $PLATFORM..."
|
|
||||||
docker buildx imagetools inspect "${IMAGE_NAME}:${TAG_VERSION}" --format "{{.Manifest.$PLATFORM.Digest}}"
|
|
||||||
done
|
|
||||||
echo "Successfully verified images in Docker Hub"
|
|
||||||
Loading…
Add table
Reference in a new issue