Skip to content

Commit

Permalink
Workflow split
Browse files Browse the repository at this point in the history
  • Loading branch information
Josh-XT committed Feb 5, 2024
1 parent bc8fbcf commit b4fc567
Show file tree
Hide file tree
Showing 2 changed files with 54 additions and 6 deletions.
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
name: Dev - Build and Test
name: Dev - CPU Build and Test

on:
push:
Expand All @@ -8,18 +8,14 @@ on:

jobs:
build-local-llm:
runs-on: self-hosted
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: "CPU"
dockerfile: "Dockerfile"
platforms: "linux/amd64"
tag_name: "cpu-dev"
- name: "CUDA"
dockerfile: "cuda.Dockerfile"
platforms: "linux/amd64"
tag_name: "cuda-dev"
steps:
- name: Checkout code
uses: actions/checkout@v4
Expand Down
52 changes: 52 additions & 0 deletions .github/workflows/publish-docker-cuda-dev.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
name: Dev - Cuda Build

on:
push:
branches-ignore:
- main
workflow_dispatch:

jobs:
build-local-llm:
runs-on: ubuntu-latest
strategy:
matrix:
include:
- name: "CUDA"
dockerfile: "cuda.Dockerfile"
platforms: "linux/amd64"
tag_name: "cuda-dev"
steps:
- name: Checkout code
uses: actions/checkout@v4

- name: Extract GitHub info
run: |
echo "BRANCH_NAME=$(echo ${GITHUB_REF#refs/heads/} | sed 's/[^a-zA-Z0-9._-]/-/g')" >> $GITHUB_ENV
echo "GITHUB_USER=$(echo ${{ github.actor }} | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
echo "REPO_NAME=$(echo ${{ github.repository }} | cut -d'/' -f 2 | tr '[:upper:]' '[:lower:]')" >> $GITHUB_ENV
id: extract_branch

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

- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ env.GITHUB_USER }}
password: ${{ secrets.GITHUB_TOKEN }}

- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
context: .
file: ./${{ matrix.dockerfile }}
platforms: ${{ matrix.platforms }}
push: true
cache-from: type=gha
cache-to: type=gha,mode=max
tags: |
ghcr.io/agixt/${{ env.REPO_NAME }}:${{ matrix.tag_name }}
ghcr.io/agixt/${{ env.REPO_NAME }}:${{ matrix.tag_name }}-${{ env.BRANCH_NAME }}
ghcr.io/agixt/${{ env.REPO_NAME }}:${{ matrix.tag_name }}-${{ env.BRANCH_NAME }}-${{ github.sha }}

0 comments on commit b4fc567

Please sign in to comment.