File tree Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Expand file tree Collapse file tree 1 file changed +18
-4
lines changed Original file line number Diff line number Diff line change 34
34
echo "BUILD_NEEDED=true" >> $GITHUB_ENV
35
35
fi
36
36
- name : Configure AWS Production credentials
37
+ if : ${{ github.ref_name == 'main' || github.ref_name == 'release' }}
37
38
uses : aws-actions/configure-aws-credentials@v4
38
39
with :
39
40
role-to-assume : arn:aws:iam::820242920762:role/GithubDeployMavisAndInfrastructure
@@ -64,16 +65,29 @@ jobs:
64
65
with :
65
66
name : image
66
67
path : image.tar
68
+ define-matrix :
69
+ name : Determine AWS roles to push the image
70
+ runs-on : ubuntu-latest
71
+ needs : check-image-presence
72
+ outputs :
73
+ aws-roles : ${{ steps.determine-aws-roles.outputs.aws-roles }}
74
+ steps :
75
+ - name : Set aws roles
76
+ id : determine-aws-roles
77
+ run : |
78
+ if [ ${{ github.ref_name }} = 'main' ] || [ ${{ github.ref_name }} = 'release' ]; then
79
+ echo 'aws-roles=["arn:aws:iam::393416225559:role/GithubDeployMavisAndInfrastructure", "arn:aws:iam::820242920762:role/GithubDeployMavisAndInfrastructure"]' >> $GITHUB_OUTPUT
80
+ else
81
+ echo 'aws-roles=["arn:aws:iam::393416225559:role/GithubDeployMavisAndInfrastructure"]' >> $GITHUB_OUTPUT
82
+ fi
67
83
push :
68
84
runs-on : ubuntu-latest
69
- needs : build
85
+ needs : [ build, define-matrix]
70
86
permissions :
71
87
id-token : write
72
88
strategy :
73
89
matrix :
74
- aws-role :
75
- - arn:aws:iam::820242920762:role/GithubDeployMavisAndInfrastructure
76
- - arn:aws:iam::393416225559:role/GithubDeployMavisAndInfrastructure
90
+ aws-role : ${{ fromJSON(needs.determine-aws-roles.outputs.aws-roles) }}
77
91
steps :
78
92
- name : Download Docker image
79
93
uses : actions/download-artifact@v4
You can’t perform that action at this time.
0 commit comments