File tree 2 files changed +26
-2
lines changed
2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 22
22
permissions :
23
23
contents : ' read'
24
24
id-token : ' write'
25
+ outputs :
26
+ environment : ${{ steps.set-github-outputs.outputs.environment }}
27
+ url : ${{ steps.set-github-outputs.outputs.url }}
25
28
steps :
29
+ -
30
+ name : Sets GitHub Outputs
31
+ id : set-github-outputs
32
+ run : |
33
+ if [ "${{ github.event_name }}" == "push" ]; then
34
+ echo "environment=prod" >> "$GITHUB_OUTPUT"
35
+ echo "url=https://demo.api-platform.com/" >> "$GITHUB_OUTPUT"
36
+ else
37
+ echo "environment=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
38
+ echo "url=https://pr-${{ github.event.pull_request.number }}-demo.api-platform.com/" >> "$GITHUB_OUTPUT"
39
+ fi
26
40
-
27
41
name : Checkout
28
42
uses : actions/checkout@v4
51
65
name : Generate NEXT_PUBLIC_OIDC_SERVER_URL
52
66
run : |
53
67
if [ "${{ github.event_name }}" == "push" ]; then
54
- echo "NEXT_PUBLIC_OIDC_SERVER_URL=https://demo.api-platform.com/oidc/realms/demo " >> $GITHUB_ENV
68
+ echo "NEXT_PUBLIC_OIDC_SERVER_URL=${{ steps.set-github-outputs.outputs.url }} " >> $GITHUB_ENV
55
69
else
56
- echo "NEXT_PUBLIC_OIDC_SERVER_URL=https://pr- ${{ github.event.pull_request.number }}-demo.api-platform.com/ oidc/realms/demo" >> $GITHUB_ENV
70
+ echo "NEXT_PUBLIC_OIDC_SERVER_URL=${{ steps.set- github-outputs.outputs.url }}oidc/realms/demo" >> $GITHUB_ENV
57
71
fi
58
72
-
59
73
name : Build Docker images
@@ -107,6 +121,8 @@ jobs:
107
121
docker-images-version : ${{ github.sha }}
108
122
gke-cluster : api-platform-demo
109
123
gke-zone : europe-west1-c
124
+ environment : ${{ needs.build.outputs.environment }}
125
+ url : ${{ needs.build.outputs.url }}
110
126
secrets :
111
127
gke-credentials : ${{ secrets.GKE_SA_KEY }}
112
128
gke-project : ${{ secrets.GKE_PROJECT }}
Original file line number Diff line number Diff line change 17
17
type : string
18
18
description : Google Kubernetes Engine Zone
19
19
required : true
20
+ environment :
21
+ type : string
22
+ description : GitHub Environment
23
+ required : true
24
+ url :
25
+ type : string
26
+ description : GitHub Environment URL
27
+ required : true
20
28
secrets :
21
29
gke-credentials :
22
30
description : Google Kubernetes Engine Credentials as JSON
You can’t perform that action at this time.
0 commit comments