Docker Build Workflow #5
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# .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 }}" |