Skip to content

Commit

Permalink
Add github workflow for chart and image builds
Browse files Browse the repository at this point in the history
  • Loading branch information
Scott Davidson committed Oct 25, 2023
1 parent 8c020c7 commit c9b7b3a
Show file tree
Hide file tree
Showing 3 changed files with 74 additions and 2 deletions.
71 changes: 71 additions & 0 deletions .github/workflows/build-push-artifacts.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,71 @@
# Adapted from https://github.com/stackhpc/azimuth/blob/master/.github/workflows/build-push-artifacts.yaml
name: Publish artifacts
# Run the tasks on every push
on: push
jobs:
build_push_images:
name: Build and push images
runs-on: ubuntu-latest
# strategy:
# matrix:
# include:
# - component: api
# - component: ui
steps:
- name: Check out the repository
uses: actions/checkout@v3

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

- name: Calculate metadata for image
id: image-meta
uses: docker/metadata-action@v4
with:
# images: ghcr.io/stackhpc/azimuth-${{ matrix.component }}
images: ghcr.io/stackhpc/azimuth-llm-ui-base
# Produce the branch name or tag and the SHA as tags
tags: |
type=ref,event=branch
type=ref,event=tag
type=sha,prefix=
- name: Build and push image
uses: stackhpc/github-actions/docker-multiarch-build-push@master
with:
# cache-key: ${{ matrix.component }}
# context: ./${{ matrix.component }}
cache-key: ui-base
context: ./images/ui
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.image-meta.outputs.tags }}
labels: ${{ steps.image-meta.outputs.labels }}

build_push_chart:
name: Build and push Helm chart
runs-on: ubuntu-latest
# Only build and push the chart if the images built successfully
needs: [build_push_images]
steps:
- name: Check out the repository
uses: actions/checkout@v3
with:
# This is important for the semver action to work correctly
# when determining the number of commits since the last tag
fetch-depth: 0

- name: Get SemVer version for current commit
id: semver
uses: stackhpc/github-actions/semver@master

- name: Publish Helm charts
uses: stackhpc/github-actions/helm-publish@master
with:
token: ${{ secrets.GITHUB_TOKEN }}
version: ${{ steps.semver.outputs.version }}
app-version: ${{ steps.semver.outputs.short-sha }}
3 changes: 2 additions & 1 deletion .helmignore
Original file line number Diff line number Diff line change
Expand Up @@ -28,4 +28,5 @@ Dockerfile
gradio-app.py
kubeconfig.yml
venv/
__pycache__/
__pycache__/
images/
2 changes: 1 addition & 1 deletion Dockerfile → images/ui-base/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@

FROM amd64/python:3.11-slim
FROM python:3.11-slim

ENV GRADIO_SERVER_PORT=7680

Expand Down

0 comments on commit c9b7b3a

Please sign in to comment.