-
Notifications
You must be signed in to change notification settings - Fork 49
92 lines (92 loc) · 4.3 KB
/
build-containers.yml
File metadata and controls
92 lines (92 loc) · 4.3 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
on:
workflow_call:
permissions:
packages: write
jobs:
containers:
runs-on: ubuntu-latest
name: ${{ matrix.name }}
defaults:
run:
shell: bash
strategy:
matrix:
include:
- name: servicecontrol
project: ServiceControl
title: ServiceControl
description: Gather status, performance and monitoring data for multiple endpoints from a single location.
- name: servicecontrol-audit
project: ServiceControl.Audit
title: ServiceControl Audit Instance
description: Provide valuable information about the message flow through a system.
- name: servicecontrol-monitoring
project: ServiceControl.Monitoring
title: ServiceControl Monitoring Instance
description: Track the health of a distributed system.
fail-fast: false
steps:
- name: Check for secrets
env:
SECRETS_AVAILABLE: ${{ secrets.SECRETS_AVAILABLE }}
shell: pwsh
run: exit $(If ($env:SECRETS_AVAILABLE -eq 'true') { 0 } Else { 1 })
- name: Checkout
uses: actions/checkout@v6.0.2
with:
fetch-depth: 0
- name: Setup .NET SDK
uses: actions/setup-dotnet@v5.2.0
with:
global-json-file: global.json
- name: Run MinVer
uses: Particular/run-minver-action@v1.0.0
- name: Validate build version
if: ${{ github.event_name == 'push' && github.ref_type == 'tag' }}
uses: ./.github/actions/validate-version
with:
version: ${{ env.MinVerVersion }}
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v4.0.0
- name: Log in to GitHub container registry
uses: docker/login-action@v3.7.0
with:
registry: ghcr.io
username: ${{ github.actor }}
password: ${{ secrets.GITHUB_TOKEN }}
- name: Get current date
id: date
run: echo "date=$(date '+%FT%TZ')" >> $GITHUB_OUTPUT
- name: Build and push image to GitHub container registry
uses: docker/build-push-action@v7.0.0
with:
context: .
push: true
platforms: linux/amd64,linux/arm64
sbom: true
labels: |
org.opencontainers.image.source=https://github.com/Particular/ServiceControl/tree/${{ github.sha }}
org.opencontainers.image.authors="Particular Software"
org.opencontainers.image.vendor="Particular Software"
org.opencontainers.image.url=https://hub.docker.com/r/particular/${{ matrix.name }}
org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/
org.opencontainers.image.version=${{ env.MinVerVersion }}
org.opencontainers.image.revision=${{ github.sha }}
org.opencontainers.image.created=${{ steps.date.outputs.date }}
org.opencontainers.image.title=${{ matrix.title }}
org.opencontainers.image.description=${{ matrix.description }}
org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite-extra
annotations: |
index:org.opencontainers.image.source=https://github.com/Particular/ServiceControl/tree/${{ github.sha }}
index:org.opencontainers.image.authors="Particular Software"
index:org.opencontainers.image.vendor="Particular Software"
index:org.opencontainers.image.url=https://hub.docker.com/r/particular/${{ matrix.name }}
index:org.opencontainers.image.documentation=https://docs.particular.net/servicecontrol/
index:org.opencontainers.image.version=${{ env.MinVerVersion }}
index:org.opencontainers.image.revision=${{ github.sha }}
index:org.opencontainers.image.created=${{ steps.date.outputs.date }}
index:org.opencontainers.image.title=${{ matrix.title }}
index:org.opencontainers.image.description=${{ matrix.description }}
index:org.opencontainers.image.base.name=mcr.microsoft.com/dotnet/aspnet:10.0-noble-chiseled-composite-extra
file: src/${{ matrix.project }}/Dockerfile
tags: ghcr.io/particular/${{ matrix.name }}:${{ github.event_name == 'pull_request' && format('pr-{0}', github.event.number) || env.MinVerVersion }}