File tree 5 files changed +65
-0
lines changed
5 files changed +65
-0
lines changed Original file line number Diff line number Diff line change 23
23
org : " Catalyst "
24
24
satellite : " ci "
25
25
}
26
+ github : {
27
+ registry : " ghcr.io "
28
+ }
26
29
}
27
30
}
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ package schema
46
46
// Earthly contains the configuration for the Earthly Cloud provider.
47
47
// +optional
48
48
earthly ?: #ProviderEarthly @go (Earthly )
49
+ github : #ProviderGithub @go (Github )
49
50
}
50
51
51
52
// ProviderAWS contains the configuration for the AWS provider.
@@ -82,6 +83,17 @@ package schema
82
83
satellite ?: null | string @go (Satellite ,*string )
83
84
}
84
85
86
+ // ProviderGithub contains the configuration for the Github provider.
87
+ #ProviderGithub : {
88
+ // Credentials contains the credentials to use for Github
89
+ // +optional
90
+ Credentials ?: #Secret
91
+
92
+ // Registry contains the Github registry to use.
93
+ // +optional
94
+ Registry ?: null | string @go (,*string )
95
+ }
96
+
85
97
// Secret contains the secret provider and a list of mappings
86
98
#Secret : {
87
99
// Path contains the path to the secret.
Original file line number Diff line number Diff line change @@ -52,6 +52,8 @@ type Providers struct {
52
52
// Earthly contains the configuration for the Earthly Cloud provider.
53
53
// +optional
54
54
Earthly ProviderEarthly `json:"earthly"`
55
+
56
+ Github ProviderGithub `json:"github"`
55
57
}
56
58
57
59
// ProviderAWS contains the configuration for the AWS provider.
@@ -88,6 +90,17 @@ type ProviderEarthly struct {
88
90
Satellite * string `json:"satellite"`
89
91
}
90
92
93
+ // ProviderGithub contains the configuration for the Github provider.
94
+ type ProviderGithub struct {
95
+ // Credentials contains the credentials to use for Github
96
+ // +optional
97
+ Credentials Secret
98
+
99
+ // Registry contains the Github registry to use.
100
+ // +optional
101
+ Registry * string
102
+ }
103
+
91
104
// Secret contains the secret provider and a list of mappings
92
105
type Secret struct {
93
106
// Path contains the path to the secret.
Original file line number Diff line number Diff line change @@ -46,6 +46,7 @@ package schema
46
46
// Earthly contains the configuration for the Earthly Cloud provider.
47
47
// +optional
48
48
earthly ?: #ProviderEarthly @go (Earthly )
49
+ github : #ProviderGithub @go (Github )
49
50
}
50
51
51
52
// ProviderAWS contains the configuration for the AWS provider.
@@ -82,6 +83,17 @@ package schema
82
83
satellite ?: null | string @go (Satellite ,*string )
83
84
}
84
85
86
+ // ProviderGithub contains the configuration for the Github provider.
87
+ #ProviderGithub : {
88
+ // Credentials contains the credentials to use for Github
89
+ // +optional
90
+ Credentials ?: #Secret
91
+
92
+ // Registry contains the Github registry to use.
93
+ // +optional
94
+ Registry ?: null | string @go (,*string )
95
+ }
96
+
85
97
// Secret contains the secret provider and a list of mappings
86
98
#Secret : {
87
99
// Path contains the path to the secret.
Original file line number Diff line number Diff line change 7
7
forge_version :
8
8
description : The version of the forge CLI to install (use 'local' for testing)
9
9
default : latest
10
+ github_token :
11
+ description : Github token assigned to CI
12
+ required : false
13
+ default : ${{ github.token }}
10
14
runs :
11
15
using : composite
12
16
steps :
92
96
username : ${{ steps.docker.outputs.username }}
93
97
password : ${{ steps.docker.outputs.password }}
94
98
99
+ # GitHub Provider
100
+ - name : Get GitHub provider configuration
101
+ id : github
102
+ shell : bash
103
+ run : |
104
+ BP=$(forge blueprint dump .)
105
+
106
+ GITHUB=$(echo "$BP" | jq -r .ci.providers.github.registry)
107
+ if [[ "$GITHUB" != "null" ]]; then
108
+ LOGIN=1
109
+ fi
110
+
111
+ echo "login=$LOGIN" >> $GITHUB_OUTPUT
112
+ - name : Login to GitHub Container Registry
113
+ uses : docker/login-action@v3
114
+ if : steps.github.outputs.login
115
+ with :
116
+ registry : ghcr.io
117
+ username : ${{ github.actor }}
118
+ password : ${{ inputs.github_token }}
119
+
95
120
# Earthly Provider
96
121
- name : Install Earthly
97
122
uses : earthly/actions-setup@v1
You can’t perform that action at this time.
0 commit comments