34
34
description : ' The organization to deploy the dataset to'
35
35
required : false
36
36
default : formance
37
- kubeconfig :
38
- description : ' The kubeconfig to use'
37
+ refresh :
38
+ default : false
39
+ description : ' Refresh the stack'
40
+ required : false
41
+ workflow_call :
42
+ secrets :
43
+ PULUMI_ACCESS_TOKEN :
44
+ required : true
45
+ KUBE_APISERVER :
46
+ required : true
47
+ KUBE_TOKEN :
48
+ required : true
49
+ TS_OAUTH_CLIENT_ID :
50
+ required : true
51
+ TS_OAUTH_SECRET :
52
+ required : true
53
+ inputs :
54
+ ledger-version :
55
+ type : string
56
+ description : ' The version of the ledger to deploy'
57
+ required : true
58
+ preview :
59
+ description : ' Preview the changes'
60
+ required : false
61
+ type : boolean
62
+ rds-db-subnet-group-name :
63
+ type : string
64
+ description : ' The network to deploy the RDS instance to'
65
+ required : false
66
+ until-log-id :
67
+ type : number
68
+ description : ' The log id to stop at'
69
+ required : false
70
+ generator-version :
71
+ type : string
72
+ default : ' latest'
73
+ description : ' The version of the generator to use'
74
+ required : false
75
+ namespace :
76
+ type : string
77
+ default : ' default'
78
+ description : ' The namespace to deploy the dataset to'
79
+ required : false
80
+ create-snapshot :
81
+ type : boolean
82
+ default : false
83
+ description : ' Create a snapshot of the dataset'
84
+ required : false
85
+ script :
86
+ type : string
39
87
required : true
88
+ description : ' The script to generate the dataset'
89
+ organization :
90
+ type : string
91
+ description : ' The organization to deploy the dataset to'
92
+ required : false
93
+ default : formance
94
+ refresh :
95
+ type : boolean
96
+ default : false
97
+ description : ' Refresh the stack'
98
+ required : false
99
+ destroy :
100
+ type : boolean
101
+ default : true
102
+ description : ' Destroy the stack'
103
+ required : false
40
104
41
105
concurrency :
42
- group : dataset-${{ github.event. inputs.ledger-version }}
106
+ group : dataset-${{ inputs.ledger-version }}
43
107
cancel-in-progress : true
44
108
45
109
jobs :
46
110
Run :
47
111
name : Generate dataset
48
112
runs-on : ubuntu-latest
113
+ permissions :
114
+ id-token : write
115
+ contents : read
49
116
steps :
50
117
- uses : actions/checkout@v4
51
118
name : Checkout
@@ -55,13 +122,18 @@ jobs:
55
122
- name : Configure AWS credentials
56
123
uses : aws-actions/configure-aws-credentials@v4
57
124
with :
58
- role-to-assume : arn:aws:iam::288350113309 :role/github-access
125
+ role-to-assume : arn:aws:iam::955332203423 :role/github-access
59
126
aws-region : eu-west-1
60
- # aws-region: us-east-1
127
+ - name : Tailscale
128
+ uses : tailscale/github-action@v2
129
+ with :
130
+ oauth-client-id : ${{ secrets.TS_OAUTH_CLIENT_ID }}
131
+ oauth-secret : ${{ secrets.TS_OAUTH_SECRET }}
132
+ tags : tag:ci
61
133
- name : Create kube config file
62
134
env :
63
- KUBE_APISERVER : ${{ secrets.FORMANCE_DEV_KUBE_API_SERVER_ADDRESS }}
64
- KUBE_TOKEN : ${{ secrets.FORMANCE_DEV_KUBE_TOKEN }}
135
+ KUBE_APISERVER : ${{ secrets.KUBE_APISERVER }}
136
+ KUBE_TOKEN : ${{ secrets.KUBE_TOKEN }}
65
137
run : |
66
138
mkdir .kube;
67
139
@@ -87,30 +159,37 @@ jobs:
87
159
- uses : pulumi/actions@v6
88
160
name : Run Pulumi
89
161
with :
90
- command : ${{ github.event. inputs.preview == 'true' && 'preview' || 'up' }}
91
- stack-name : ${{ github.event. inputs.organization }}/ledger-dataset/${{ github.event. inputs.ledger-version }}
162
+ command : ${{ inputs.preview && 'preview' || 'up' }}
163
+ stack-name : ${{ inputs.organization }}/ledger-dataset/${{ inputs.ledger-version }}
92
164
work-dir : ' ./tools/dataset'
165
+ suppress-progress : ' true'
166
+ refresh : ${{ inputs.refresh }}
93
167
config-map : |
94
168
ledger-version:
95
- value: ${{ github.event. inputs.ledger-version }}
169
+ value: ${{ inputs.ledger-version }}
96
170
rds-db-subnet-group-name:
97
- value: ${{ github.event. inputs.rds-db-subnet-group-name }}
171
+ value: ${{ inputs.rds-db-subnet-group-name }}
98
172
until-log-id:
99
- value: ${{ github.event. inputs.until-log-id }}
173
+ value: ${{ inputs.until-log-id }}
100
174
generator-version:
101
- value: ${{ github.event. inputs.generator-version }}
175
+ value: ${{ inputs.generator-version }}
102
176
namespace:
103
- value: ${{ github.event. inputs.namespace }}
177
+ value: ${{ inputs.namespace }}
104
178
create-snapshot:
105
- value: ${{ github.event. inputs.create-snapshot }}
179
+ value: ${{ inputs.create-snapshot }}
106
180
script:
107
- value: "${{ github.event. inputs.script }}"
108
- upsert : ' true'
181
+ value: "${{ inputs.script }}"
182
+ upsert : true
109
183
env :
110
184
PULUMI_ACCESS_TOKEN : ${{ secrets.PULUMI_ACCESS_TOKEN }}
185
+ KUBECONFIG : /home/runner/work/ledger/ledger/.kube/config
111
186
- uses : pulumi/actions@v6
112
187
name : Clean resources
188
+ if : ${{ inputs.destroy && !inputs.preview }}
113
189
with :
114
190
command : destroy
115
- stack-name : ${{ github.event.inputs.organization }}/ledger-dataset/${{ github.event.inputs.ledger-version }}
116
- work-dir : ' ./tools/dataset'
191
+ stack-name : ${{ inputs.organization }}/ledger-dataset/${{ inputs.ledger-version }}
192
+ work-dir : ' ./tools/dataset'
193
+ env :
194
+ PULUMI_ACCESS_TOKEN : ${{ secrets.PULUMI_ACCESS_TOKEN }}
195
+ KUBECONFIG : /home/runner/work/ledger/ledger/.kube/config
0 commit comments