-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add github workflow for chart and image builds
- Loading branch information
Scott Davidson
committed
Oct 25, 2023
1 parent
8c020c7
commit c9b7b3a
Showing
3 changed files
with
74 additions
and
2 deletions.
There are no files selected for viewing
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
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 }} |
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
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -28,4 +28,5 @@ Dockerfile | |
gradio-app.py | ||
kubeconfig.yml | ||
venv/ | ||
__pycache__/ | ||
__pycache__/ | ||
images/ |
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
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 | ||
|
||
|