-
Notifications
You must be signed in to change notification settings - Fork 19
86 lines (73 loc) · 2.77 KB
/
Copy pathcd.yml
File metadata and controls
86 lines (73 loc) · 2.77 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
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
name: CD
on:
push:
branches:
- master
jobs:
cd:
name: Build and Publish
runs-on: ubuntu-latest
steps:
- name: Clone the code
uses: actions/checkout@v4
with:
fetch-depth: 0
- name: Setup Go
uses: actions/setup-go@v5
with:
go-version-file: go.mod
- name: Build operator image
run: |
SHA=$(git rev-parse --short HEAD)
make container-build IMG=quay.io/codeready-toolchain/claw-operator:${SHA}
- name: Build proxy image
run: |
SHA=$(git rev-parse --short HEAD)
make container-build-proxy PROXY_IMG=quay.io/codeready-toolchain/claw-proxy:${SHA}
- name: Login to Quay.io
env:
QUAY_USERNAME: ${{ secrets.QUAY_USERNAME }}
QUAY_TOKEN: ${{ secrets.QUAY_TOKEN }}
run: |
set -euo pipefail
: "${QUAY_USERNAME:?QUAY_USERNAME secret is required}"
: "${QUAY_TOKEN:?QUAY_TOKEN secret is required}"
REGISTRY_AUTH_FILE="${RUNNER_TEMP}/containers-auth.json"
export REGISTRY_AUTH_FILE
echo "REGISTRY_AUTH_FILE=${REGISTRY_AUTH_FILE}" >> "${GITHUB_ENV}"
podman login --authfile "${REGISTRY_AUTH_FILE}" \
-u "${QUAY_USERNAME}" --password-stdin quay.io <<< "${QUAY_TOKEN}"
- name: Push operator image
run: |
SHA=$(git rev-parse --short HEAD)
make container-push IMG=quay.io/codeready-toolchain/claw-operator:${SHA}
- name: Push proxy image
run: |
SHA=$(git rev-parse --short HEAD)
make container-push-proxy PROXY_IMG=quay.io/codeready-toolchain/claw-proxy:${SHA}
- name: Publish staging bundle and catalog
run: make push-to-quay-staging
- name: Create Kind cluster for scorecard
continue-on-error: true
id: kind
run: |
make kind
bin/kind create cluster --name scorecard
- name: Wait for cluster ready
id: cluster_ready
if: steps.kind.outcome == 'success'
continue-on-error: true
run: |
kubectl wait --for=condition=Ready nodes --all --timeout=60s
kubectl -n default wait --for=jsonpath='{.metadata.name}'=default serviceaccount/default --timeout=60s
- name: Run scorecard tests
if: steps.kind.outcome == 'success' && steps.cluster_ready.outcome == 'success'
continue-on-error: true
run: |
bin/operator-sdk scorecard ./bundle \
--kubeconfig=$HOME/.kube/config \
--wait-time=120s \
--output=text || echo "::warning::Scorecard tests failed (non-blocking)"
- name: Cleanup Kind cluster
if: always() && steps.kind.outcome == 'success'
run: bin/kind delete cluster --name scorecard