Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Push to docker hub #371

Merged
merged 6 commits into from
Dec 17, 2024
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
46 changes: 46 additions & 0 deletions .github/workflows/dockerhub.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,46 @@
name: build | Build and Push Docker Image to DockerHub

on:
push:
branches:
- main

jobs:
docker-build-and-push:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v3
borisarzentar marked this conversation as resolved.
Show resolved Hide resolved

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
borisarzentar marked this conversation as resolved.
Show resolved Hide resolved

- name: Log in to Docker Hub
uses: docker/login-action@v2
borisarzentar marked this conversation as resolved.
Show resolved Hide resolved
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
borisarzentar marked this conversation as resolved.
Show resolved Hide resolved

- name: Extract Git information
id: git-info
run: |
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/\\//-/g')" >> $GITHUB_ENV
echo "COMMIT_SHA=$(git rev-parse --short HEAD)" >> $GITHUB_ENV

borisarzentar marked this conversation as resolved.
Show resolved Hide resolved
- name: Build and Push Docker Image
run: |
IMAGE_NAME=cognee/cognee
TAG_VERSION="${BRANCH_NAME}-${COMMIT_SHA}"

echo "Building image: ${IMAGE_NAME}:${TAG_VERSION}"
docker buildx build \
--platform linux/amd64,linux/arm64 \
--push \
--tag "${IMAGE_NAME}:${TAG_VERSION}" \
--tag "${IMAGE_NAME}:latest" \
.

borisarzentar marked this conversation as resolved.
Show resolved Hide resolved
- name: Verify pushed Docker images
run: |
echo "Successfully pushed images to Docker Hub"
borisarzentar marked this conversation as resolved.
Show resolved Hide resolved
borisarzentar marked this conversation as resolved.
Show resolved Hide resolved
borisarzentar marked this conversation as resolved.
Show resolved Hide resolved
Loading