-
Notifications
You must be signed in to change notification settings - Fork 33
148 lines (148 loc) · 5.74 KB
/
master.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
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
on:
push:
branches:
- master
name: Publish Master
jobs:
build-and-publish-operator:
name: Build and Publish Operator
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version information
run: |
echo "RELEASE_VERSION=master" >> $GITHUB_ENV
echo "RELEASE_COMMIT=$(git rev-parse --verify HEAD)" >> $GITHUB_ENV
echo "RELEASE_DATE=$(date --iso-8601=seconds)" >> $GITHUB_ENV
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build but don't push
uses: docker/build-push-action@v5
with:
context: .
# Because we use a container scanner pre-push we don't specify platform here so only the runner platform builds
# platforms: linux/amd64,linux/arm64
load: true
tags: ${{ github.repository_owner }}/humio-operator:${{ env.RELEASE_VERSION }}
labels: |
version=${{ env.RELEASE_VERSION }}
release=${{ github.run_id }}
build-args: |
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
RELEASE_COMMIT=${{ env.RELEASE_COMMIT }}
RELEASE_DATE=${{ env.RELEASE_DATE }}
cache-to: type=local,type=registry,type=gha
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install six
python -m pip install --upgrade retry
pip install retry
- name: CrowdStrike Container Image Scan Operator
if: github.repository_owner == 'humio'
uses: crowdstrike/container-image-scan-action@v1
with:
falcon_client_id: 1cd30708cb31442f85a6eec83279fe7b
container_repository: ${{ github.repository_owner }}/humio-operator
container_tag: ${{ env.RELEASE_VERSION }}
env:
FALCON_CLIENT_SECRET: "${{ secrets.FALCON_CLIENT_SECRET }}"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: .
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ github.repository_owner }}/humio-operator:${{ env.RELEASE_VERSION }}
${{ github.repository_owner }}/humio-operator:${{ env.RELEASE_COMMIT }}
labels: |
version=${{ env.RELEASE_VERSION }}
release=${{ github.run_id }}
build-args: |
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
RELEASE_COMMIT=${{ env.RELEASE_COMMIT }}
RELEASE_DATE=${{ env.RELEASE_DATE }}
cache-from: type=gha, mode=max
cache-to: type=gha
build-and-publish-helper:
name: Build and Publish Helperimage
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set version information
run: |
echo "RELEASE_VERSION=master" >> $GITHUB_ENV
echo "RELEASE_COMMIT=$(git rev-parse --verify HEAD)" >> $GITHUB_ENV
echo "RELEASE_DATE=$(date --iso-8601=seconds)" >> $GITHUB_ENV
- name: copy license to helper image dir
run: cp LICENSE images/helper/
- name: Set up QEMU
uses: docker/setup-qemu-action@v3
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v3
- name: Login to DockerHub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Build but don't push
uses: docker/build-push-action@v5
with:
context: images/helper
# Because we use a container scanner pre-push we don't specify platform here so only the runner platform builds
# platforms: linux/amd64,linux/arm64
load: true
tags: ${{ github.repository_owner }}/humio-operator-helper:${{ env.RELEASE_VERSION }}
labels: |
version=${{ env.RELEASE_VERSION }}
release=${{ github.run_id }}
build-args: |
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
RELEASE_COMMIT=${{ env.RELEASE_COMMIT }}
RELEASE_DATE=${{ env.RELEASE_DATE }}
cache-to: type=local,type=registry,type=gha
- name: Set up Python
uses: actions/setup-python@v5
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install six
python -m pip install --upgrade retry
pip install retry
- name: CrowdStrike Container Image Scan Operator Helper
if: github.repository_owner == 'humio'
uses: crowdstrike/container-image-scan-action@v1
with:
falcon_client_id: 1cd30708cb31442f85a6eec83279fe7b
container_repository: ${{ github.repository_owner }}/humio-operator-helper
container_tag: ${{ env.RELEASE_VERSION }}
env:
FALCON_CLIENT_SECRET: "${{ secrets.FALCON_CLIENT_SECRET }}"
- name: Build and push
uses: docker/build-push-action@v5
with:
context: images/helper
platforms: linux/amd64,linux/arm64
push: true
tags: |
${{ github.repository_owner }}/humio-operator-helper:${{ env.RELEASE_VERSION }}
${{ github.repository_owner }}/humio-operator-helper:${{ env.RELEASE_COMMIT }}
labels: |
version=${{ env.RELEASE_VERSION }}
release=${{ github.run_id }}
build-args: |
RELEASE_VERSION=${{ env.RELEASE_VERSION }}
RELEASE_COMMIT=${{ env.RELEASE_COMMIT }}
RELEASE_DATE=${{ env.RELEASE_DATE }}
cache-from: type=gha, mode=max
cache-to: type=gha