Skip to content

fix: image name for oci not being passed on building gh flows #5

fix: image name for oci not being passed on building gh flows

fix: image name for oci not being passed on building gh flows #5

name: snc-runner-builder
on:
push:
tags: [ '*' ]
paths:
- '.github\/workflows\/snc-runner\/release-info'
pull_request:
branches: [ main ]
paths:
- 'snc-runner/**'
- '.github\/workflows\/snc-runner*'
jobs:
build:
name: build
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Build image for PR
if: ${{ github.event_name == 'pull_request' }}
env:
# SNC_RUNNER: ghcr.io/crc-org/ci-snc-runner
SNC_RUNNER: ghcr.io/adrianriobo/ci-snc-runner
SNC_RUNNER_V: pr-${{ github.event.number }}
run: |
make snc-runner-oci-build
make snc-runner-oci-save
echo "image=${SNC_RUNNER}:${SNC_RUNNER_V}" >> "$GITHUB_ENV"
- name: Build image for Release
if: ${{ github.event_name == 'push' }}
run: |
make snc-runner-oci-build
make snc-runner-oci-save
# Get values from release-info
IMAGE=$(sed -n 1p snc-runner/release-info)
TAG=v$(sed -n 2p snc-runner/release-info)
echo "image=${IMAGE}:${TAG}" >> "$GITHUB_ENV"
- name: Create image metadata
run: |
echo ${{ env.image }} > snc-runner-image
echo ${{ github.event_name }} > snc-runner-build-event
- name: Upload snc-runner
uses: actions/upload-artifact@v4
with:
name: snc-runner
path: snc-runner*
tkn-check:
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
- name: Template tkn for PR
if: ${{ github.event_name == 'pull_request' }}
env:
# CRC_BUILDER: ghcr.io/crc-org/ci-crc-builder
CRC_BUILDER: ghcr.io/adrianriobo/ci-snc-runner
CRC_BUILDER_V: pr-${{ github.event.number }}
run: |
make snc-runner-tkn-create
- name: Check tkn for release
if: ${{ github.event_name == 'push' }}
run: |
[ ! -f snc-runner/tkn/task.yaml ] && exit 1
# Check if version is in sync
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1
# https://docs.openshift.com/pipelines/1.15/about/op-release-notes.html
- name: Deploy min supported tekton version
run: kubectl apply -f https://storage.googleapis.com/tekton-releases/pipeline/previous/v0.44.5/release.yaml
- name: Deploy tasks
run: |
kubectl apply -f snc-runner/tkn/task.yaml
- name: Upload crc-builder-tkn
uses: actions/upload-artifact@v4
with:
name: snc-runner-tkn
path: snc-runner/tkn/task.yaml