-
Notifications
You must be signed in to change notification settings - Fork 3
131 lines (111 loc) · 3.71 KB
/
crc-builder-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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
name: crc-builder-builder
on:
push:
tags: [ 'crc-builder-v*' ]
pull_request:
branches: [ main ]
paths: ['crc-builder/**', '.github\/workflows\/crc-builder*' ]
jobs:
build-on-pull:
name: build-on-pull
if: ${{ github.event_name == 'pull_request' }}
permissions:
contents: read
packages: write
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
# Allow emulation for building multi arch images
- name: Prepare runner
shell: bash
run: |
sudo apt-get install -y qemu-user-static
- name: Build image
env:
CRC_BUILDER: ghcr.io/${{ github.actor }}/ci-crc-builder
CRC_BUILDER_V: pr-${{ github.event.number }}
run: |
make crc-builder-oci-build
- name: Log in to ghcr.io
uses: redhat-actions/podman-login@v1
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Push image crc-builder
env:
CRC_BUILDER: ghcr.io/${{ github.repository_owner }}/ci-crc-builder
CRC_BUILDER_V: pr-${{ github.event.number }}
run: |
make crc-builder-oci-push
build-on-push:
name: build-on-push
if: ${{ github.event_name == 'push' }}
runs-on: ubuntu-24.04
steps:
- name: Checkout code
uses: actions/checkout@v4
# Allow emulation for building multi arch images
- name: Prepare runner
shell: bash
run: |
sudo apt-get install -y qemu-user-static
- name: Build image for Release
run: |
make crc-builder-oci-build
- name: Log in quay.io
if: ${{ env.source_event == 'push' }}
uses: redhat-actions/podman-login@v1
with:
registry: quay.io
username: ${{ secrets.QUAY_IO_USERNAME }}
password: ${{ secrets.QUAY_IO_PASSWORD }}
- name: Push crc-builder
run: |
make crc-builder-oci-push
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_V: pr-${{ github.event.number }}
run: |
make crc-builder-tkn-create
echo "image=${CRC_BUILDER}:${CRC_BUILDER_V}" >> "$GITHUB_ENV"
- name: Create image metadata
run: |
echo ${{ env.image }} > crc-builder-image
echo ${{ github.event_name }} > crc-builder-build-event
- name: Check tkn specs
run: |
if [[ ! -f crc-builder/tkn/crc-builder-installer.yaml ]]; then
exit 1
fi
if [[ ! -f crc-builder/tkn/crc-builder.yaml ]]; then
exit 1
fi
# 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 crc-builder/tkn/crc-builder-installer.yaml
kubectl apply -f crc-builder/tkn/crc-builder.yaml
- name: Upload crc-builder-tkn
uses: actions/upload-artifact@v4
with:
name: crc-builder-tkn
path: crc-builder/tkn/crc-builder*
- name: Upload crc-builder
uses: actions/upload-artifact@v4
with:
name: crc-builder
path: crc-builder*