Skip to content

Commit 4895bd7

Browse files
committed
[WIP] push image to registry
1 parent 09f0343 commit 4895bd7

File tree

3 files changed

+58
-1
lines changed

3 files changed

+58
-1
lines changed
Lines changed: 54 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,54 @@
1+
name: Build and push
2+
on:
3+
pull_request:
4+
5+
permissions:
6+
pull-requests: write
7+
contents: write
8+
9+
jobs:
10+
install-podman:
11+
name: build-push-image
12+
runs-on: ubuntu-latest
13+
14+
steps:
15+
- name: Checkout Push to Registry action
16+
uses: actions/checkout@v4
17+
18+
- name: Install latest podman
19+
run: |
20+
bash .github/workflows/scripts/install_latest_podman.sh
21+
22+
# Build image using Buildah action
23+
- name: Build Image
24+
id: build_image
25+
uses: redhat-actions/buildah-build@v2
26+
with:
27+
image: ${{ secret.IMAGE_NAME }}
28+
layers: false
29+
tags: ${{ github.event.pull_request.number }}
30+
dockerfiles: |
31+
./Dockerfile
32+
33+
# Authenticate to container image registry to push the image
34+
- name: Podman Login
35+
uses: redhat-actions/podman-login@v1
36+
with:
37+
registry: ${{ env.IMAGE_REGISTRY }}
38+
username: ${{ secrets.TEMP_USER }}
39+
password: ${{ secrets.TEMP_TOKEN }}
40+
41+
# Push the image to Image Registry)
42+
- name: Push To Image registry
43+
uses: ./
44+
id: push
45+
with:
46+
image: ${{ steps.build_image.outputs.image }}
47+
tags: ${{ steps.build_image.outputs.tags }}
48+
registry: ${{ env.IMAGE_REGISTRY }}/${{ env.TEMP_NAMESPACE }}
49+
extra-args: |
50+
--disable-content-trust
51+
52+
- name: Echo outputs
53+
run: |
54+
echo "${{ toJSON(steps.push.outputs) }}"
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
sudo apt-get update
2+
sudo apt-get -y upgrade
3+
sudo apt-get -y install podman

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ IMAGE_BUILD_CMD = $(shell which podman 2>/dev/null || which docker)
22
IMAGE_REGISTRY ?= "quay.io"
33
REGISTRY_NAMESPACE ?= "opendatahub"
44
IMAGE_NAME="opendatahub-tests"
5-
IMAGE_TAG ?= "latest"
5+
IMAGE_TAG ?= "latest-test"
66

77
FULL_OPERATOR_IMAGE ?= "$(IMAGE_REGISTRY)/$(REGISTRY_NAMESPACE)/$(IMAGE_NAME):$(IMAGE_TAG)"
88

0 commit comments

Comments
 (0)