-
Notifications
You must be signed in to change notification settings - Fork 0
54 lines (46 loc) · 1.37 KB
/
pull.yml
File metadata and controls
54 lines (46 loc) · 1.37 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
---
name: Pull
on:
workflow_run:
workflows: ["Build"]
types:
- completed
permissions:
contents: read
jobs:
detect:
runs-on: arc
if: ${{ github.event.workflow_run.conclusion == 'success' }}
outputs:
images: ${{ steps.find.outputs.images }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Find all images
id: find
run: |
images=$(find . -maxdepth 2 -name Containerfile | cut -d'/' -f2 | jq -R -s -c 'split("\n") | map(select(length > 0))')
echo "images=$images" >> "$GITHUB_OUTPUT"
import:
needs: detect
if: needs.detect.outputs.images != '[]'
runs-on: arc
strategy:
matrix:
image: ${{ fromJson(needs.detect.outputs.images) }}
steps:
- name: Install OpenShift CLI
uses: redhat-actions/oc-installer@v1
- name: Login to OpenShift
uses: redhat-actions/oc-login@v1
with:
openshift_server_url: ${{ secrets.OPENSHIFT_SERVER_URL }}
openshift_token: ${{ secrets.OPENSHIFT_TOKEN }}
insecure_skip_tls_verify: true
- name: Import image to OpenShift
run: |
oc import-image ${{ matrix.image }}:latest \
--from=ghcr.io/makeitworkcloud/${{ matrix.image }}:latest \
-n public-registry \
--confirm \
--reference-policy=local || true