-
Notifications
You must be signed in to change notification settings - Fork 0
64 lines (58 loc) · 2.01 KB
/
build-push-images.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
# Adapted from https://github.com/stackhpc/azimuth/blob/master/.github/workflows/build-push-artifacts.yaml
name: Publish container images
on:
workflow_call:
inputs:
ref:
type: string
description: The ref to build.
required: true
jobs:
build_push_images:
name: Build and push images
runs-on: ubuntu-latest
strategy:
matrix:
component:
- chat
- image-analysis
- flux-image-gen
permissions:
contents: read
id-token: write # needed for signing the images with GitHub OIDC Token
packages: write # required for pushing container images
security-events: write # required for pushing SARIF files
steps:
- name: Check out the repository
uses: actions/checkout@v4
with:
ref: ${{ inputs.ref }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get SemVer version for current commit
id: semver
uses: azimuth-cloud/github-actions/semver@master
- name: Calculate metadata for image
id: image-meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/stackhpc/azimuth-llm-${{ matrix.component }}-ui
# Produce the branch name or tag and the SHA as tags
tags: |
type=ref,event=branch
type=ref,event=tag
type=raw,value=${{ steps.semver.outputs.short-sha }}
- name: Build and push image
uses: azimuth-cloud/github-actions/docker-multiarch-build-push@master
with:
cache-key: ${{ matrix.component }}
context: ./web-apps/
file: ./web-apps/${{ matrix.component }}/Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: ${{ steps.image-meta.outputs.tags }}
labels: ${{ steps.image-meta.outputs.labels }}