Skip to content

Commit 3b877d8

Browse files
Added container image publish to forwarder
1 parent 49a79fa commit 3b877d8

File tree

1 file changed

+20
-21
lines changed

1 file changed

+20
-21
lines changed

.github/workflows/build.yaml

Lines changed: 20 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@ jobs:
2121
steps:
2222
- name: Checkout repo
2323
uses: actions/checkout@v2
24-
2524
- name: Bash shell lint check with shellcheck
2625
uses: reviewdog/action-shellcheck@v1
2726
with:
@@ -38,7 +37,6 @@ jobs:
3837
steps:
3938
- name: Checkout repo
4039
uses: actions/checkout@v2
41-
4240
- name: 'Yaml lint'
4341
uses: karancode/yamllint-github-action@master
4442
with:
@@ -56,32 +54,25 @@ jobs:
5654
steps:
5755
- name: Checkout repo
5856
uses: actions/checkout@v2
59-
6057
- name: Create Dotnet environment
6158
uses: actions/setup-dotnet@v1
6259
with:
6360
dotnet-version: '3.1.100' # SDK Version to use.
64-
6561
- name: Restore cached nuget packages
6662
uses: actions/cache@v1
6763
with:
6864
path: ${{ github.workspace }}/.nuget/packages
6965
key: ${{ runner.os }}-nuget-${{ hashFiles('**/packages.lock.json') }}
7066
restore-keys: |
7167
${{ runner.os }}-nuget-
72-
7368
- name: Dotnet lint install dotnet-format for linting
7469
run: dotnet tool install -g dotnet-format --version 3.3.111304
75-
7670
- name: Dotnet lint install report generator
7771
uses: xt0rted/dotnet-format-problem-matcher@v1
78-
7972
- name: Dotnet lint check with dotnet-format
80-
run: dotnet format --folder AKSKubeAuditReceiverSolution/ --check --dry-run || true
81-
73+
run: dotnet format --folder AKSKubeAuditReceiverSolution/ --check --dry-run || true
8274
- name: Dotnet build solution
8375
run: dotnet build AKSKubeAuditReceiverSolution/AKSKubeAuditReceiver.sln
84-
8576
- name: Dotnet test solution
8677
run: dotnet test AKSKubeAuditReceiverSolution/AKSKubeAuditReceiver.sln
8778

@@ -144,7 +135,6 @@ jobs:
144135
echo ${{ toJSON(steps.cis_dockerfile_benchmark.outputs.violation_report) }} > /tmp/report
145136
reportString=$(sed 's/"/\\"/g' /tmp/report)
146137
echo $reportString
147-
148138
# send result to Sysdig monitor
149139
curl -X POST -s https://app.sysdigcloud.com/api/events -H 'Content-Type: application/json; charset=UTF-8' -H 'Authorization: Bearer '"${SYSDIG_SECURE_TOKEN}"'' -d '{"event":{"name":"CIS Dockerfile Benchmark - PR: '"${PR_TITLE}"' ","description":"'"${reportString}"'","severity":"6"}}' --compressed
150140
echo "###"
@@ -194,11 +184,11 @@ jobs:
194184
echo "Scan result: $SCAN_RESULT"
195185
# exit $SCAN_RESULT
196186
197-
198187
publish_images:
199188
name: Publish container images to registries
200189
needs: [sysdig_image_scan_forwarder]
201-
# We do not depend on scan of installer as check_shell can't run on release, so we skip those jobs
190+
# We do not depend on scan of installer as check_shell can't run on release,
191+
# and scan for installer result is skipped
202192
runs-on: ubuntu-16.04
203193
if: github.event_name == 'release'
204194
steps:
@@ -213,12 +203,12 @@ jobs:
213203
with:
214204
username: ${{ secrets.DOCKERHUB_USERNAME }}
215205
password: ${{ secrets.DOCKERHUB_PASSWORD }}
216-
# - name: Login to GitHub Container Registry
217-
# uses: docker/login-action@v1
218-
# with:
219-
# registry: ghcr.io
220-
# username: ${{ github.repository_owner }}
221-
# password: ${{ secrets.CR_PAT }}
206+
- name: Login to GitHub Container Registry
207+
uses: docker/login-action@v1
208+
with:
209+
registry: ghcr.io
210+
username: ${{ github.repository_owner }}
211+
password: ${{ secrets.CR_PAT_PKG }}
222212
- name: Prepare version major
223213
id: prepare_version_major
224214
env:
@@ -239,5 +229,14 @@ jobs:
239229
sysdiglabs/aks-audit-log-installer:latest
240230
sysdiglabs/aks-audit-log-installer:${{ github.event.release.tag_name }}
241231
sysdiglabs/aks-audit-log-installer:${{ steps.prepare_version_major.outputs.VERSION_MAJOR }}
242-
243-
# ghcr.io/sysdiglabs/aks-audit-log-installer:latest
232+
- name: Build and push - Forwarder
233+
uses: docker/build-push-action@v2
234+
with:
235+
context: AKSKubeAuditReceiverSolution/AKSKubeAuditReceiver/
236+
file: AKSKubeAuditReceiverSolution/AKSKubeAuditReceiver/Dockerfile
237+
platforms: linux/amd64
238+
push: true
239+
tags: |
240+
sysdiglabs/aks-audit-log-forwarder:latest
241+
sysdiglabs/aks-audit-log-forwarder:${{ github.event.release.tag_name }}
242+
sysdiglabs/aks-audit-log-forwarder:${{ steps.prepare_version_major.outputs.VERSION_MAJOR }}

0 commit comments

Comments
 (0)