-
Notifications
You must be signed in to change notification settings - Fork 70
195 lines (173 loc) · 5.91 KB
/
build_release.yaml
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
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
name: Build Release
on:
release:
types: [published]
workflow_dispatch:
inputs:
tag:
description: 'Tag to build (leave empty for latest)'
required: false
default: ''
permissions:
packages: write
contents: write
jobs:
build_vcr_agent:
name: 'Build VCR Agent'
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/aries-vcr-agent
tags: |
type=raw,value=${{ github.event.inputs.tag }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
- name: Build and push image
id: builder
uses: docker/build-push-action@v6
with:
context: ./docker/vcr-agent
file: ./docker/vcr-agent/Dockerfile
push: true
tags: ${{ steps.meta.outputs.tags }}
labels: ${{ steps.meta.outputs.labels }}
build_vcr_api:
name: 'Build VCR API'
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/aries-vcr-api
tags: |
type=raw,value=${{ github.event.inputs.tag }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
- name: Setup and build
id: build_image
uses: redhat-actions/s2i-build@v2
with:
path_context: ./server/vcr-server
builder_image: 'registry.access.redhat.com/ubi9/python-39'
image: ghcr.io/${{ github.repository }}/aries-vcr-api
tags: ${{ steps.meta.outputs.tags }}
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.meta.outputs.version }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
build_db:
name: 'Build DB'
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/aries-vcr-db
tags: |
type=raw,value=${{ github.event.inputs.tag }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
- name: Setup and build
id: build_image
uses: redhat-actions/s2i-build@v2
with:
path_context: ./server/db/config
builder_image: 'quay.io/fedora/postgresql-12:12'
image: ghcr.io/${{ github.repository }}/aries-vcr-db
tags: ${{ steps.meta.outputs.tags }}
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.meta.outputs.version }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
build_vcr_solr:
name: 'Build VCR Solr'
runs-on: ubuntu-latest
if: github.repository_owner == 'bcgov'
steps:
- uses: actions/checkout@v4
with:
fetch-depth: 0
ref: ${{ github.event.inputs.tag || github.ref }}
- name: Login to GitHub Container Registry
uses: docker/login-action@v3
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Prepare docker tags for image
id: meta
uses: docker/metadata-action@v5
with:
images: ghcr.io/${{ github.repository }}/aries-vcr-solr
tags: |
type=raw,value=${{ github.event.inputs.tag }}
type=semver,pattern={{version}}
type=semver,pattern={{major}}.{{minor}}
type=ref,event=tag
- name: Setup and build
id: build_image
uses: redhat-actions/s2i-build@v2
with:
path_context: ./server/solr/cores
builder_image: 'https://github.com/bcgov/openshift-solr.git#8.11.2'
image: ghcr.io/${{ github.repository }}/aries-vcr-solr
tags: ${{ steps.meta.outputs.tags }}
- name: Push image
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ steps.build_image.outputs.image }}
tags: ${{ steps.meta.outputs.version }}
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}