49
49
echo "role=$ROLE" >> $GITHUB_OUTPUT
50
50
- name : Configure AWS
51
51
uses : aws-actions/configure-aws-credentials@v4
52
- if : ${{ steps.aws.outputs.region != '' && steps.aws.outputs.role != '' }}
52
+ if : steps.aws.outputs.region != '' && steps.aws.outputs.role != ''
53
53
with :
54
54
aws-region : ${{ steps.aws.outputs.region }}
55
55
role-to-assume : ${{ steps.aws.outputs.role }}
@@ -73,11 +73,45 @@ runs:
73
73
fi
74
74
fi
75
75
76
+ echo "::add-mask::$USERNAME"
77
+ echo "::add-mask::$PASSWORD"
78
+
76
79
echo "username=$USERNAME" >> $GITHUB_OUTPUT
77
80
echo "password=$PASSWORD" >> $GITHUB_OUTPUT
78
81
- name : Login to Docker Hub
79
82
uses : docker/login-action@v3
80
- if : ${{ steps.docker.outputs.username != '' && steps.docker.outputs.password != '' }}
83
+ if : steps.docker.outputs.username != '' && steps.docker.outputs.password != ''
81
84
with :
82
85
username : ${{ steps.docker.outputs.username }}
83
- password : ${{ steps.docker.outputs.password }}
86
+ password : ${{ steps.docker.outputs.password }}
87
+
88
+ # Earthly Provider
89
+ - name : Install Earthly
90
+ uses : earthly/actions-setup@v1
91
+ if : inputs.forge_version != 'local'
92
+ with :
93
+ version : ${{ inputs.earthly_version }}
94
+ - name : Get Earthly provider configuration
95
+ id : earthly
96
+ shell : bash
97
+ run : |
98
+ BP=$(forge blueprint dump .)
99
+
100
+ EARTHLY=$(echo "$BP" | jq -r .ci.providers.earthly.credentials)
101
+ if [[ "$EARTHLY" != "null" ]]; then
102
+ SECRET=$(forge secret get -b . ci.providers.earthly.credentials)
103
+ TOKEN=$(echo "$EARTHLY" | jq -r .token)
104
+
105
+ if [[ "$TOKEN" == "null" ]]; then
106
+ echo "Error: the earthly provider secret must map the secret value to 'token'"
107
+ exit 1
108
+ fi
109
+ fi
110
+
111
+ echo "::add-mask::$TOKEN"
112
+ echo "token=$TOKEN" >> $GITHUB_OUTPUT
113
+ - name : Login to Earthly Cloud
114
+ if : steps.earthly.outputs.token != ''
115
+ shell : bash
116
+ run : |
117
+ earthly account login --token "${{ steps.earthly.outputs.token }}"
0 commit comments