Skip to content

Docker Build Workflow #5

Docker Build Workflow

Docker Build Workflow #5

Workflow file for this run

# .github/workflows/docker-build.yml
name: Docker Build Workflow
# Define the triggers for this workflow
on:
push:
branches:
- main
paths:
- psql-cli/**/*
- llama.cpp-base/**/*
- llama.cpp/**/*
workflow_dispatch: # enables manual runs
jobs:
validate:
name: Validate Environment
runs-on: ubuntu-latest
services:
docker:
image: docker:20.10.16
options: --privileged
env:
DOCKER_TLS_CERTDIR: "/certs"
CI_REGISTRY_PATH: index.docker.io/ahoylabs
CI_REGISTRY_USER: ${{ secrets.CI_REGISTRY_USER }}
CI_REGISTRY_PASSWORD: ${{ secrets.CI_REGISTRY_PASSWORD }}
steps:
- name: Set up Docker
run: |
docker info
docker login -u "${{ secrets.CI_REGISTRY_USER }}" -p "${{ secrets.CI_REGISTRY_PASSWORD }}" ${{ env.CI_REGISTRY_PATH }}
- name: Print Environment Variables
run: |
echo "GitHub Actions env"
printenv
echo "CI_REGISTRY_USER ${{ secrets.CI_REGISTRY_USER }}"
echo "CI_REGISTRY_PASSWORD ${{ secrets.CI_REGISTRY_PASSWORD }}"
echo "CI_REGISTRY_PATH ${{ env.CI_REGISTRY_PATH }}"
build_psql_cli:
name: Build psql-cli Image
runs-on: ubuntu-latest
needs: validate
services:
docker:
image: docker:20.10.16
options: --privileged
env:
IMAGE: psql-cli
CI_REGISTRY_PATH: index.docker.io/ahoylabs
CI_REGISTRY_USER: ${{ secrets.CI_REGISTRY_USER }}
CI_REGISTRY_PASSWORD: ${{ secrets.CI_REGISTRY_PASSWORD }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
run: docker login -u "${{ secrets.CI_REGISTRY_USER }}" -p "${{ secrets.CI_REGISTRY_PASSWORD }}"
- name: Build psql-cli Docker image
run: |
cd $IMAGE
docker build --pull -t "${{ env.CI_REGISTRY_PATH }}/${{ env.IMAGE }}" .
docker push "${{ env.CI_REGISTRY_PATH }}/${{ env.IMAGE }}"
build_llama_base:
name: Build llama.cpp-base Image
runs-on: ubuntu-latest
needs: validate
services:
docker:
image: docker:20.10.16
options: --privileged
env:
IMAGE: llama.cpp-base
CI_REGISTRY_PATH: index.docker.io/ahoylabs
CI_REGISTRY_USER: ${{ secrets.CI_REGISTRY_USER }}
CI_REGISTRY_PASSWORD: ${{ secrets.CI_REGISTRY_PASSWORD }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
run: docker login -u "${{ secrets.CI_REGISTRY_USER }}" -p "${{ secrets.CI_REGISTRY_PASSWORD }}"
- name: Build llama.cpp-base Docker image
run: |
cd $IMAGE
docker build --pull -t "${{ env.CI_REGISTRY_PATH }}/${{ env.IMAGE }}" .
docker push "${{ env.CI_REGISTRY_PATH }}/${{ env.IMAGE }}"
build_llama:
name: Build llama.cpp Image
runs-on: ubuntu-latest
needs: validate
services:
docker:
image: docker:20.10.16
options: --privileged
env:
IMAGE: llama.cpp
CI_REGISTRY_PATH: index.docker.io/ahoylabs
CI_REGISTRY_USER: ${{ secrets.CI_REGISTRY_USER }}
CI_REGISTRY_PASSWORD: ${{ secrets.CI_REGISTRY_PASSWORD }}
steps:
- name: Check out repository
uses: actions/checkout@v4
- name: Log in to Docker Hub
run: docker login -u "${{ secrets.CI_REGISTRY_USER }}" -p "${{ secrets.CI_REGISTRY_PASSWORD }}"
- name: Build llama.cpp Docker image
run: |
cd $IMAGE
docker build --pull -t "${{ env.CI_REGISTRY_PATH }}/${{ env.IMAGE }}" .
docker push "${{ env.CI_REGISTRY_PATH }}/${{ env.IMAGE }}"