File tree 5 files changed +32
-9
lines changed
5 files changed +32
-9
lines changed Original file line number Diff line number Diff line change 1
1
version : " 1.0 "
2
2
ci : {
3
+ registries : [
4
+ ci .providers .aws .registry ,
5
+ ]
3
6
providers : {
4
7
aws : {
5
- region : " eu-central-1 "
6
- role : " arn:aws:iam::332405224602:role/ci "
8
+ region : " eu-central-1 "
9
+ registry : " 332405224602.dkr.ecr.eu-central-1.amazonaws.com "
10
+ role : " arn:aws:iam::332405224602:role/ci "
7
11
}
8
12
docker : {
9
13
credentials : {
Original file line number Diff line number Diff line change @@ -16,9 +16,9 @@ package schema
16
16
// +optional
17
17
providers ?: #Providers @go (Providers )
18
18
19
- // Registry contains the registry to push images to.
19
+ // Registries contains the container registries to push images to.
20
20
// +optional
21
- registry ?: null | string @go (Registry , * string )
21
+ registries ?: [... string ] @go (Registries , [] string )
22
22
23
23
// Secrets contains the configuration for the secrets being used by the CI system.
24
24
// +optional
@@ -55,6 +55,10 @@ package schema
55
55
56
56
// Region contains the region to use.
57
57
region ?: null | string @go (Region ,*string )
58
+
59
+ // Registry contains the ECR registry to use.
60
+ // +optional
61
+ registry ?: null | string @go (Registry ,*string )
58
62
}
59
63
60
64
// ProviderDocker contains the configuration for the DockerHub provider.
Original file line number Diff line number Diff line change @@ -26,9 +26,9 @@ type CI struct {
26
26
// +optional
27
27
Providers Providers `json:"providers"`
28
28
29
- // Registry contains the registry to push images to.
29
+ // Registries contains the container registries to push images to.
30
30
// +optional
31
- Registry * string `json:"registry "`
31
+ Registries [] string `json:"registries "`
32
32
33
33
// Secrets contains the configuration for the secrets being used by the CI system.
34
34
// +optional
@@ -61,6 +61,10 @@ type ProviderAWS struct {
61
61
62
62
// Region contains the region to use.
63
63
Region * string `json:"region"`
64
+
65
+ // Registry contains the ECR registry to use.
66
+ // +optional
67
+ Registry * string `json:"registry"`
64
68
}
65
69
66
70
// ProviderDocker contains the configuration for the DockerHub provider.
Original file line number Diff line number Diff line change @@ -20,9 +20,9 @@ package schema
20
20
// +optional
21
21
providers ?: #Providers @go (Providers )
22
22
23
- // Registry contains the registry to push images to.
23
+ // Registries contains the container registries to push images to.
24
24
// +optional
25
- registry ?: null | string @go (Registry , * string )
25
+ registries ?: [... string ] @go (Registries , [] string )
26
26
27
27
// Secrets contains the configuration for the secrets being used by the CI system.
28
28
// +optional
@@ -55,6 +55,10 @@ package schema
55
55
56
56
// Region contains the region to use.
57
57
region ?: null | string @go (Region ,*string )
58
+
59
+ // Registry contains the ECR registry to use.
60
+ // +optional
61
+ registry ?: null | string @go (Registry ,*string )
58
62
}
59
63
60
64
// ProviderDocker contains the configuration for the DockerHub provider.
Original file line number Diff line number Diff line change @@ -42,17 +42,24 @@ runs:
42
42
AWS=$(echo "$BP" | jq -r .ci.providers.aws)
43
43
if [[ "$AWS" != "null" ]]; then
44
44
REGION=$(echo "$BP" | jq -r .ci.providers.aws.region)
45
+ REGISTRY=$(echo "$BP" | jq -r .ci.providers.aws.registry)
45
46
ROLE=$(echo "$BP" | jq -r .ci.providers.aws.role)
46
47
fi
47
48
48
49
echo "region=$REGION" >> $GITHUB_OUTPUT
50
+ echo "registry=$REGISTRY" >> $GITHUB_OUTPUT
49
51
echo "role=$ROLE" >> $GITHUB_OUTPUT
50
- - name : Configure AWS
52
+ - name : Login to AWS
51
53
uses : aws-actions/configure-aws-credentials@v4
52
54
if : steps.aws.outputs.region != '' && steps.aws.outputs.role != ''
53
55
with :
54
56
aws-region : ${{ steps.aws.outputs.region }}
55
57
role-to-assume : ${{ steps.aws.outputs.role }}
58
+ - name : Login to ECR
59
+ uses : docker/login-action@v3
60
+ if : steps.aws.outputs.registry != ''
61
+ with :
62
+ registry : ${{ steps.aws.outputs.registry }}
56
63
57
64
# Docker Provider
58
65
- name : Get Docker provider configuration
You can’t perform that action at this time.
0 commit comments