Skip to content

Commit 7d9a22d

Browse files
authored
include sbom in container images (#59)
1 parent 2b01de9 commit 7d9a22d

File tree

5 files changed

+71
-116
lines changed

5 files changed

+71
-116
lines changed

.github/workflows/docker.yaml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
name: Docker Build Action
2+
3+
on:
4+
pull_request:
5+
branches:
6+
- master
7+
push:
8+
branches:
9+
- master
10+
release:
11+
types:
12+
- published
13+
14+
env:
15+
REGISTRY: ghcr.io
16+
IMAGE_NAME: ${{ github.repository }}
17+
18+
jobs:
19+
build:
20+
runs-on: ubuntu-latest
21+
steps:
22+
- name: Checkout
23+
uses: actions/checkout@v4
24+
25+
- name: Docker Login
26+
uses: docker/login-action@v3
27+
with:
28+
registry: ${{ secrets.DOCKER_REGISTRY }}
29+
username: ${{ secrets.DOCKER_REGISTRY_USER }}
30+
password: ${{ secrets.DOCKER_REGISTRY_TOKEN }}
31+
if: ${{ github.event_name != 'pull_request' }}
32+
33+
- name: Set up Go 1.24
34+
uses: actions/setup-go@v5
35+
with:
36+
go-version: '1.24.x'
37+
38+
- name: Lint
39+
uses: golangci/golangci-lint-action@v7
40+
41+
- name: Make tag
42+
run: |
43+
[ "${GITHUB_EVENT_NAME}" == 'pull_request' ] && echo "tag=pr-${GITHUB_HEAD_REF##*/}" >> $GITHUB_ENV || true
44+
[ "${GITHUB_EVENT_NAME}" == 'release' ] && echo "tag=${GITHUB_REF##*/}" >> $GITHUB_ENV || true
45+
[ "${GITHUB_EVENT_NAME}" == 'push' ] && echo "tag=latest" >> $GITHUB_ENV || true
46+
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
50+
- name: Build and push image
51+
uses: docker/build-push-action@v6
52+
with:
53+
context: .
54+
push: ${{ github.event_name != 'pull_request' }}
55+
sbom: true
56+
tags: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}:${{ env.tag }}

.github/workflows/latest.yaml

Lines changed: 0 additions & 37 deletions
This file was deleted.

.github/workflows/pull_requests.yaml

Lines changed: 0 additions & 45 deletions
This file was deleted.
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
---
2+
name: Release Drafter Action
3+
4+
on:
5+
push:
6+
branches:
7+
- master
8+
9+
jobs:
10+
build:
11+
runs-on: ubuntu-latest
12+
steps:
13+
- uses: release-drafter/release-drafter@v6
14+
env:
15+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

.github/workflows/release.yaml

Lines changed: 0 additions & 34 deletions
This file was deleted.

0 commit comments

Comments
 (0)