-
Notifications
You must be signed in to change notification settings - Fork 1
130 lines (118 loc) · 4.55 KB
/
build-and-push-docker-image.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
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
on:
workflow_dispatch:
inputs:
langtrace-ingest-image-tag:
description: 'Langtrace Ingress Docker image tag'
required: false
langtrace-ui-image-tag:
description: 'Langtrace UI Docker image tag'
required: false
langtrace-api-image-tag:
description: 'Langtrace API Docker image tag'
required: false
jobs:
push_ingest_to_ghcr:
if: ${{ !cancelled() && inputs.langtrace-ingest-image-tag != null }}
name: Build and push Langtrace ingest component to Github Container Registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Log in to the Container registry
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker build
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: ghcr.io/${{ github.repository_owner }}/langtrace-ingest
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}},value=${{ inputs.langtrace-ingest-image-tag }}
- name: Build and push Docker image
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5
with:
file: ./Dockerfile.ingest
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
push_ui_to_ghcr:
if: ${{ !cancelled() && inputs.langtrace-ui-image-tag != null }}
name: Build and push Langtrace UI component to Github Container Registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Log in to the Container registry
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker build
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: ghcr.io/${{ github.repository_owner }}/langtrace-ui
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}},value=${{ inputs.langtrace-ui-image-tag }}
- name: Build and push Docker image
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5
with:
file: ./Dockerfile.ui
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
# This is here to placate the build process and can be overridden at runtime.
build-args: |
LANGTRACE_API_URL=http://localhost:1994
push_api_to_ghcr:
if: ${{ !cancelled() && inputs.langtrace-api-image-tag != null }}
name: Build and push Langtrace API component to Github Container Registry
runs-on: ubuntu-latest
permissions:
contents: read
packages: write
steps:
- name: Checkout
uses: actions/checkout@b4ffde65f46336ab88eb53be808477a3936bae11 # v4
- name: Log in to the Container registry
uses: docker/login-action@5139682d94efc37792e6b54386b5b470a68a4737
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get metadata for Docker build
id: meta
uses: docker/metadata-action@8e5442c4ef9f78752691e2d8f8d19755c6f78e81 # v5
with:
images: ghcr.io/${{ github.repository_owner }}/langtrace-api
tags: |
type=schedule
type=ref,event=branch
type=ref,event=tag
type=ref,event=pr
type=semver,pattern={{version}},value=${{ inputs.langtrace-api-image-tag }}
- name: Build and push Docker image
uses: docker/build-push-action@af5a7ed5ba88268d5278f7203fb52cd833f66d6e # v5
with:
file: ./Dockerfile.api
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}