Skip to content

Commit 8d8c523

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

File tree

3 files changed

+60
-1
lines changed

3 files changed

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