-
Notifications
You must be signed in to change notification settings - Fork 8
70 lines (68 loc) · 2.73 KB
/
_build-images.yml
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
on:
workflow_call:
inputs:
runner:
required: true
type: string
arch:
required: true
type: string
dotnet_variant:
required: true
type: string
dotnet_versions:
required: true
type: string
docker_distros:
required: true
type: string
env:
DOTNET_INSTALL_DIR: "./.dotnet"
DOTNET_ROLL_FORWARD: "Major"
PUSH_IMAGES: ${{ github.event_name != 'pull_request' && github.repository_owner == 'GitTools' }}
jobs:
build_images:
name: ${{ matrix.docker_distro }} - net${{ matrix.dotnet_version }}
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
docker_distro: ${{ fromJson(inputs.docker_distros) }}
dotnet_version: ${{ fromJson(inputs.dotnet_versions) }}
steps:
- name: Checkout
uses: actions/checkout@v4
- name: Use cached cake frosting
id: cache-cake
uses: actions/cache@v4
with:
path: run
key: run-${{ runner.os }}-${{ hashFiles('./build/**') }}
- name: Setup .NET SDK
uses: actions/setup-dotnet@v4
with:
global-json-file: build/global.json
- name: Set up Docker
uses: ./.github/actions/docker-setup
- name: Publish image to DockerHub
uses: ./.github/actions/build-images
with:
arch: ${{ inputs.arch }}
dotnet_variant: ${{ inputs.dotnet_variant }}
dotnet_version: ${{ matrix.dotnet_version }}
docker_distro: ${{ matrix.docker_distro }}
docker_registry: docker.io
docker_registry_name: dockerhub
docker_registry_username: ${{ secrets.DOCKER_USERNAME }}
docker_registry_password: ${{ secrets.DOCKER_PASSWORD }}
- name: Publish image to GitHub
uses: ./.github/actions/build-images
with:
arch: ${{ inputs.arch }}
dotnet_variant: ${{ inputs.dotnet_variant }}
dotnet_version: ${{ matrix.dotnet_version }}
docker_distro: ${{ matrix.docker_distro }}
docker_registry: ghcr.io
docker_registry_name: github
docker_registry_username: ${{ github.repository_owner }}
docker_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }}