Skip to content

Commit dc8d499

Browse files
committed
feat: oci image builder to be used as part of a multistage build strategy
This image will act as a cache for the node modules requried to build the extension Signed-off-by: Adrian Riobo Lorenzo <[email protected]>
1 parent 12bba3d commit dc8d499

File tree

2 files changed

+76
-0
lines changed

2 files changed

+76
-0
lines changed

.github/workflows/build-builder.yaml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
#
2+
# Copyright (C) 2024 Red Hat, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
name: build-builder
19+
20+
on:
21+
push:
22+
branches:
23+
- main
24+
25+
jobs:
26+
build-and-push-image:
27+
runs-on: ubuntu-24.04
28+
permissions:
29+
contents: read
30+
packages: write
31+
32+
steps:
33+
- name: Checkout repository
34+
uses: actions/checkout@44c2b7a8a4ea60a981eaca3cf939b5f4305c123b # v4.1.5
35+
36+
- name: Build Image
37+
id: build-image
38+
uses: redhat-actions/buildah-build@7a95fa7ee0f02d552a32753e7414641a04307056 #v2.17
39+
with:
40+
image: ghcr.io/${{ github.repository }}-builder
41+
tags: latest ${{ github.sha }}
42+
containerfiles: |
43+
./oci/Containerfile.builder
44+
45+
- name: Push To Registry
46+
uses: redhat-actions/push-to-registry@5ed88d269cf581ea9ef6dd6806d01562096bee9c #v2.8
47+
with:
48+
image: ${{ steps.build-image.outputs.image }}
49+
tags: ${{ steps.build-image.outputs.tags }}
50+
registry: ghcr.io
51+
username: ${{ github.actor }}
52+
password: ${{ secrets.GITHUB_TOKEN }}

oci/Containerfile.builder

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
#
2+
# Copyright (C) 2024 Red Hat, Inc.
3+
#
4+
# Licensed under the Apache License, Version 2.0 (the "License");
5+
# you may not use this file except in compliance with the License.
6+
# You may obtain a copy of the License at
7+
#
8+
# http://www.apache.org/licenses/LICENSE-2.0
9+
#
10+
# Unless required by applicable law or agreed to in writing, software
11+
# distributed under the License is distributed on an "AS IS" BASIS,
12+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
# See the License for the specific language governing permissions and
14+
# limitations under the License.
15+
#
16+
# SPDX-License-Identifier: Apache-2.0
17+
18+
FROM registry.access.redhat.com/ubi9/nodejs-20
19+
20+
COPY package.json .
21+
22+
RUN npm install yarn --global \
23+
&& yarn --frozen-lockfile --network-timeout 180000
24+

0 commit comments

Comments
 (0)