This repository was archived by the owner on Feb 9, 2026. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 2
138 lines (116 loc) · 4.72 KB
/
Copy pathcontainers_develop.yml
File metadata and controls
138 lines (116 loc) · 4.72 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
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
132
133
134
135
136
137
138
name: containers (develop)
on:
push:
branches:
- "**"
jobs:
ship:
if: github.repository == 'patrickmx/mailhog-operator'
runs-on: ubuntu-latest
env:
MANAGER_IMAGE_NAME: mailhog-operator
BUNDLE_IMAGE_NAME: mailhog-operator-bundle
CATALOG_IMAGE_NAME: mailhog-operator-catalog
REGISTRY: ghcr.io/patrickmx
steps:
- name: setup go
uses: actions/setup-go@v3
with:
go-version: 1.18
- name: checkout
uses: actions/checkout@v3
- name: run unit test
run: make test
- name: buildah manager
id: manager-build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.MANAGER_IMAGE_NAME }}
tags: ${{ github.sha }} develop
layers: true
labels: |
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.title=Mailhog Operator (Develop)
containerfiles: |
./Dockerfile
- name: GHCR login
uses: redhat-actions/podman-login@v1
with:
registry: ${{ env.REGISTRY }}
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: push manager develop image to GHCR
id: manager-develop-push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.MANAGER_IMAGE_NAME }}
tags: develop
registry: ${{ env.REGISTRY }}
- name: manager develop successfully pushed
run: echo "manager develop image pushed to ${{ steps.manager-develop-push-to-ghcr.outputs.registry-paths }}"
- name: buildah bundle
id: bundle-build-image
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.BUNDLE_IMAGE_NAME }}
tags: ${{ github.sha }} develop
layers: true
labels: |
org.opencontainers.image.source=https://github.com/patrickmx/mailhog-operator
org.opencontainers.image.title=Mailhog Operator - Config Bundle (Develop)
org.opencontainers.image.description=deploy mailhogs on crc / oc
org.opencontainers.image.revision=${{ github.sha }}
containerfiles: |
./bundle.Dockerfile
- name: push bundle develop image to GHCR
id: bundle-develop-push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.BUNDLE_IMAGE_NAME }}
tags: develop
registry: ${{ env.REGISTRY }}
- name: bundle develop successfully pushed
run: echo "bundle develop image pushed to ${{ steps.bundle-develop-push-to-ghcr.outputs.registry-paths }}"
- name: Create catalog
run: make catalog-build CATALOG_IMG=ghcr.io/patrickmx/mailhog-operator-catalog:develop BUNDLE_IMG=ghcr.io/patrickmx/mailhog-operator-bundle:develop
- name: push catalog develop image to GHCR
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.CATALOG_IMAGE_NAME }}
tags: develop
registry: ${{ env.REGISTRY }}
- name: Create labeled catalog dockerfile
run: |
cat <<EOF >catalog.Dockerfile
FROM ${{ env.CATALOG_IMAGE_NAME }}:develop
LABEL \
org.opencontainers.image.source="https://github.com/patrickmx/mailhog-operator" \
org.opencontainers.image.title="Mailhog Operator - Catalog Index (Develop)" \
org.opencontainers.image.description="Mailhog Operator - OLM Bundle Catalog / Index Image" \
org.opencontainers.image.revision="${{ github.sha }}"
EOF
- name: Add labels to catalog
uses: redhat-actions/buildah-build@v2
with:
image: ${{ env.CATALOG_IMAGE_NAME }}
tags: ${{ github.sha }} develop
containerfiles: |
./catalog.Dockerfile
- name: push catalog develop image to GHCR
id: catalog-develop-push-to-ghcr
uses: redhat-actions/push-to-registry@v2
with:
image: ${{ env.CATALOG_IMAGE_NAME }}
tags: develop
registry: ${{ env.REGISTRY }}
- name: catalog develop successfully pushed
run: echo "catalog develop image pushed to ${{ steps.catalog-develop-push-to-ghcr.outputs.registry-paths }}"
- name: Create k8s Kind Cluster
uses: helm/kind-action@v1.2.0
- name: get operator sdk
run: |
make operator-sdk
- name: run scorecard
run: |
bin/operator-sdk scorecard ghcr.io/patrickmx/mailhog-operator-bundle:develop -o text --selector=test=basic-check-spec-test --wait-time 120s
bin/operator-sdk scorecard ghcr.io/patrickmx/mailhog-operator-bundle:develop -o text --selector=suite=olm --wait-time 120s