Skip to content

Commit 89e15c5

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

File tree

3 files changed

+55
-1
lines changed

3 files changed

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