|
8 | 8 | - master |
9 | 9 | tags: |
10 | 10 | - "*" |
11 | | - # Also allow publication to be done via a workflow call |
12 | | - # In this case, the chart version is returned as an output |
13 | | - workflow_call: |
14 | | - inputs: |
15 | | - ref: |
16 | | - type: string |
17 | | - description: The ref to build. |
18 | | - required: true |
19 | | - outputs: |
20 | | - chart-version: |
21 | | - description: The chart version that was published |
22 | | - value: ${{ jobs.build_push_chart.outputs.chart-version }} |
23 | 11 |
|
24 | 12 | jobs: |
25 | | - build_push_images: |
26 | | - name: Build and push images |
27 | | - runs-on: ubuntu-latest |
28 | | - strategy: |
29 | | - matrix: |
30 | | - include: |
31 | | - - component: chat |
32 | | - - component: image-analysis |
33 | | - permissions: |
34 | | - contents: read |
35 | | - id-token: write # needed for signing the images with GitHub OIDC Token |
36 | | - packages: write # required for pushing container images |
37 | | - security-events: write # required for pushing SARIF files |
38 | | - steps: |
39 | | - - name: Check out the repository |
40 | | - uses: actions/checkout@v4 |
41 | | - with: |
42 | | - ref: ${{ inputs.ref || github.ref }} |
43 | | - |
44 | | - - name: Login to GitHub Container Registry |
45 | | - uses: docker/login-action@v3 |
46 | | - with: |
47 | | - registry: ghcr.io |
48 | | - username: ${{ github.actor }} |
49 | | - password: ${{ secrets.GITHUB_TOKEN }} |
50 | | - |
51 | | - - name: Get SemVer version for current commit |
52 | | - id: semver |
53 | | - uses: azimuth-cloud/github-actions/semver@master |
54 | | - |
55 | | - - name: Calculate metadata for image |
56 | | - id: image-meta |
57 | | - uses: docker/metadata-action@v5 |
58 | | - with: |
59 | | - images: ghcr.io/stackhpc/azimuth-llm-${{ matrix.component }}-ui |
60 | | - # Produce the branch name or tag and the SHA as tags |
61 | | - tags: | |
62 | | - type=ref,event=branch |
63 | | - type=ref,event=tag |
64 | | - type=raw,value=${{ steps.semver.outputs.short-sha }} |
65 | | -
|
66 | | - - name: Build and push image |
67 | | - uses: azimuth-cloud/github-actions/docker-multiarch-build-push@master |
68 | | - with: |
69 | | - cache-key: ${{ matrix.component }} |
70 | | - context: ./web-apps/ |
71 | | - file: ./web-apps/${{ matrix.component }}/Dockerfile |
72 | | - platforms: linux/amd64,linux/arm64 |
73 | | - push: true |
74 | | - tags: ${{ steps.image-meta.outputs.tags }} |
75 | | - labels: ${{ steps.image-meta.outputs.labels }} |
76 | | - |
77 | | - build_push_chart: |
78 | | - name: Build and push Helm chart |
79 | | - runs-on: ubuntu-latest |
80 | | - # Only build and push the chart if the images built successfully |
81 | | - needs: [build_push_images] |
82 | | - outputs: |
83 | | - chart-version: ${{ steps.semver.outputs.version }} |
84 | | - steps: |
85 | | - - name: Check out the repository |
86 | | - uses: actions/checkout@v4 |
87 | | - with: |
88 | | - ref: ${{ inputs.ref || github.ref }} |
89 | | - # This is important for the semver action to work correctly |
90 | | - # when determining the number of commits since the last tag |
91 | | - fetch-depth: 0 |
92 | | - |
93 | | - - name: Get SemVer version for current commit |
94 | | - id: semver |
95 | | - uses: azimuth-cloud/github-actions/semver@master |
96 | | - |
97 | | - - name: Publish Helm charts |
98 | | - uses: azimuth-cloud/github-actions/helm-publish@master |
99 | | - with: |
100 | | - token: ${{ secrets.GITHUB_TOKEN }} |
101 | | - version: ${{ steps.semver.outputs.version }} |
102 | | - app-version: ${{ steps.semver.outputs.short-sha }} |
| 13 | + publish_images: |
| 14 | + uses: ./.github/workflows/build-push-images.yml |
| 15 | + with: |
| 16 | + ref: ${{ github.ref }} |
| 17 | + secrets: inherit |
| 18 | + |
| 19 | + publish_charts: |
| 20 | + uses: ./.github/workflows/build-push-charts.yml |
| 21 | + with: |
| 22 | + ref: ${{ github.ref }} |
| 23 | + secrets: inherit |
0 commit comments