File tree Expand file tree Collapse file tree 2 files changed +26
-2
lines changed
Expand file tree Collapse file tree 2 files changed +26
-2
lines changed Original file line number Diff line number Diff line change 2222 permissions :
2323 contents : ' read'
2424 id-token : ' write'
25+ outputs :
26+ environment : ${{ steps.set-github-outputs.outputs.environment }}
27+ url : ${{ steps.set-github-outputs.outputs.url }}
2528 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=demo.api-platform.com" >> "$GITHUB_OUTPUT"
36+ else
37+ echo "environment=pr-${{ github.event.pull_request.number }}" >> "$GITHUB_OUTPUT"
38+ echo "url=pr-${{ github.event.pull_request.number }}-demo.api-platform.com" >> "$GITHUB_OUTPUT"
39+ fi
2640 -
2741 name : Checkout
2842 uses : actions/checkout@v4
5165 name : Generate NEXT_PUBLIC_OIDC_SERVER_URL
5266 run : |
5367 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=https://${{ steps.set-github-outputs.outputs.url }}/ " >> $GITHUB_ENV
5569 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=https://${{ steps.set- github-outputs.outputs.url }}oidc/realms/demo/ " >> $GITHUB_ENV
5771 fi
5872 -
5973 name : Build Docker images
@@ -107,6 +121,8 @@ jobs:
107121 docker-images-version : ${{ github.sha }}
108122 gke-cluster : api-platform-demo
109123 gke-zone : europe-west1-c
124+ environment : ${{ needs.build.outputs.environment }}
125+ url : ${{ needs.build.outputs.url }}
110126 secrets :
111127 gke-credentials : ${{ secrets.GKE_SA_KEY }}
112128 gke-project : ${{ secrets.GKE_PROJECT }}
Original file line number Diff line number Diff line change 1717 type : string
1818 description : Google Kubernetes Engine Zone
1919 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
2028 secrets :
2129 gke-credentials :
2230 description : Google Kubernetes Engine Credentials as JSON
You can’t perform that action at this time.
0 commit comments