-
Notifications
You must be signed in to change notification settings - Fork 654
78 lines (77 loc) · 2.32 KB
/
_docker.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
71
72
73
74
75
76
77
78
on:
workflow_call:
inputs:
runner:
required: true
type: string
arch:
required: true
type: string
dockerDistros:
required: true
type: string
dotnetVersions:
required: true
type: string
env:
DOTNET_INSTALL_DIR: "./.dotnet"
DOTNET_ROLL_FORWARD: "Major"
jobs:
docker:
name: ${{ matrix.dockerDistro }} - net${{ matrix.dotnetVersion }}
runs-on: ${{ inputs.runner }}
strategy:
fail-fast: false
matrix:
dockerDistro: ${{ fromJson(inputs.dockerDistros) }}
dotnetVersion: ${{ fromJson(inputs.dotnetVersions) }}
steps:
-
name: Checkout
uses: actions/checkout@v4
with:
fetch-depth: 0
-
name: Restore State
uses: ./.github/actions/cache-restore
-
uses: actions/download-artifact@v4
name: Download nuget packages
with:
name: nuget
path: ${{ github.workspace }}/artifacts/packages/nuget
-
name: Set up Docker
uses: crazy-max/ghaction-setup-docker@v3
with:
daemon-config: '{ "features": { "containerd-snapshotter": true } }'
-
name: Setup QEMU
uses: docker/setup-qemu-action@v3
-
name: Setup Docker Buildx
uses: docker/setup-buildx-action@v3
with:
version: 'latest'
driver-opts: 'image=moby/buildkit:buildx-stable-1'
install: true
-
name: Docker Test
if: success() && github.event_name == 'pull_request' || github.repository_owner != 'GitTools'
uses: ./.github/actions/docker-test
with:
arch: ${{ inputs.arch }}
dockerDistro: ${{ matrix.dockerDistro }}
dotnetVersion: ${{ matrix.dotnetVersion }}
-
name: Docker Publish
if: success() && github.event_name != 'pull_request' && github.repository_owner == 'GitTools' && github.ref_name == 'main'
uses: ./.github/actions/docker-publish
with:
arch: ${{ inputs.arch }}
dockerDistro: ${{ matrix.dockerDistro }}
dotnetVersion: ${{ matrix.dotnetVersion }}
docker_registry_username: ${{ secrets.DOCKER_USERNAME }}
docker_registry_password: ${{ secrets.DOCKER_PASSWORD }}
github_registry_username: ${{ github.repository_owner }}
github_registry_password: ${{ secrets.DOCKER_GITHUB_TOKEN }}