@@ -9,49 +9,6 @@ export const zoneID = "430ba34c138cfb5360826c4909f99be8"
99export const awsStage = $app . stage === "production" ? "production" : "dev"
1010export const deployAws = $app . stage === awsStage
1111
12- const githubActionsDeployRole = ( ( ) => {
13- if ( $app . stage !== "dev" && $app . stage !== "production" ) return
14-
15- const provider = new aws . iam . OpenIdConnectProvider ( "GithubActionsOidcProvider" , {
16- url : "https://token.actions.githubusercontent.com" ,
17- clientIdLists : [ "sts.amazonaws.com" ] ,
18- } )
19- const role = new aws . iam . Role ( "GithubActionsDeployRole" , {
20- name : `opencode-${ $app . stage } -github-actions-deploy` ,
21- maxSessionDuration : 3600 ,
22- assumeRolePolicy : aws . iam . getPolicyDocumentOutput ( {
23- statements : [
24- {
25- effect : "Allow" ,
26- actions : [ "sts:AssumeRoleWithWebIdentity" ] ,
27- principals : [ { type : "Federated" , identifiers : [ provider . arn ] } ] ,
28- conditions : [
29- {
30- test : "StringEquals" ,
31- variable : "token.actions.githubusercontent.com:aud" ,
32- values : [ "sts.amazonaws.com" ] ,
33- } ,
34- {
35- test : "StringEquals" ,
36- variable : "token.actions.githubusercontent.com:sub" ,
37- values : [ `repo:anomalyco/opencode:environment:${ $app . stage } ` ] ,
38- } ,
39- ] ,
40- } ,
41- ] ,
42- } ) . json ,
43- } )
44-
45- new aws . iam . RolePolicyAttachment ( "GithubActionsDeployRoleAdmin" , {
46- role : role . name ,
47- policyArn : "arn:aws:iam::aws:policy/AdministratorAccess" ,
48- } )
49-
50- return role
51- } ) ( )
52-
53- export const githubActionsDeployRoleArn = githubActionsDeployRole ?. arn
54-
5512new cloudflare . RegionalHostname ( "RegionalHostname" , {
5613 hostname : domain ,
5714 regionKey : "us" ,
0 commit comments