Skip to content

Commit

Permalink
Merge pull request #870 from dcSpark/fix/ci-cd-auto-docker
Browse files Browse the repository at this point in the history
Build Docker Images on tagged releases.
  • Loading branch information
guillevalin authored Feb 13, 2025
2 parents a784ceb + e7a61bb commit 1341202
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 9 deletions.
29 changes: 28 additions & 1 deletion .github/workflows/build-binaries.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ on:
- 'v[0-9]+.[0-9]+.[0-9]+'

jobs:
build:
build-binaries:
name: Build binary
strategy:
matrix:
Expand Down Expand Up @@ -86,3 +86,30 @@ jobs:
asset_name: shinkai-node-${{ matrix.arch }}.zip
tag: ${{ github.ref }}
overwrite: true
build-docker-image:
name: Build and push Docker image to Docker Hub
runs-on: ubuntu-latest
steps:
- name: Checkout repository
uses: actions/checkout@v4

- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./cloud-node/Dockerfile
push: true
build-args: |
BUILD_TYPE=release
tags: |
dcspark/shinkai-node:${{ github.ref_name }}
dcspark/shinkai-node:release-latest
13 changes: 5 additions & 8 deletions .github/workflows/build-docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,18 +12,15 @@ on:
- debug
- release
tag:
description: 'Docker image tag'
description: 'Docker image tag (e.g. v0.9.10)'
required: true
type: string
default: 'latest'

env:
IMAGE_NAME: ${{ secrets.DOCKERHUB_USERNAME }}/shinkai-node

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

name: Build Docker image
steps:
- name: Checkout repository
uses: actions/checkout@v4
Expand All @@ -46,5 +43,5 @@ jobs:
build-args: |
BUILD_TYPE=${{ inputs.build_type }}
tags: |
${{ env.IMAGE_NAME }}:${{ inputs.tag }}
${{ env.IMAGE_NAME }}:${{ inputs.build_type }}-latest
dcspark/shinkai-node:${{ inputs.tag }}
dcspark/shinkai-node:${{ inputs.build_type }}-latest

0 comments on commit 1341202

Please sign in to comment.