Skip to content

Pull

Pull #24

Workflow file for this run

---
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