Skip to content

Commit d140ef2

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

File tree

3 files changed

+56
-1
lines changed

3 files changed

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