-
Notifications
You must be signed in to change notification settings - Fork 3
52 lines (44 loc) · 1.61 KB
/
snc-runner-oci-builder.yaml
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
name: snc-runner-oci-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_V: pr-${{ github.event.number }}
run: |
make snc-runner-oci-build
SNC_RUNNER_SAVE=snc-runner make snc-runner-oci-save
echo "SNC_RUNNER=${SNC_RUNNER}" >> "$GITHUB_ENV"
echo "SNC_RUNNER_V=${SNC_RUNNER_V}" >> "$GITHUB_ENV"
- name: Build image for Release
if: ${{ github.event_name == 'push' }}
run: |
make snc-runner-oci-build
SNC_RUNNER_SAVE=snc-runner make snc-runner-oci-save
# Get values from release-info
SNC_RUNNER ?= $(sed -n 1p snc-runner/release-info)
SNC_RUNNER_V ?= v$(sed -n 2p snc-runner/release-info)
echo "SNC_RUNNER=${SNC_RUNNER}" >> "$GITHUB_ENV"
echo "SNC_RUNNER_V=${SNC_RUNNER_V}" >> "$GITHUB_ENV"
- name: Create image metadata
run: |
echo ${{ env.SNC_RUNNER }}:${{ env.SNC_RUNNER_V }} > snc-runner-info
echo ${{ github.event_name }} > snc-runner-build-event
- name: Upload snc-runner
uses: actions/upload-artifact@v4
with:
name: snc-runner
path: snc-runner*