@@ -3,21 +3,8 @@ name: Cloud Foundry
33on :
44 workflow_call :
55 inputs :
6- cf-api :
7- description : ' Cloud Foundry API endpoint'
8- required : false
9- type : string
10- cf-org :
11- description : ' Cloud Foundry organization'
12- required : false
13- type : string
14- cf-space :
15- description : ' Cloud Foundry space'
16- required : false
17- type : string
186 environment :
19- description : ' Deployment environment name'
20- required : true
7+ default : ' Staging'
218 type : string
229
2310 workflow_dispatch :
@@ -40,27 +27,22 @@ jobs:
4027 deploy :
4128 runs-on : ubuntu-latest
4229 steps :
43- - uses : actions/checkout@v4
30+ - uses : actions/checkout@v5
4431 with :
4532 submodules : true
46- - uses : actions/setup-node@v4
33+ - uses : actions/setup-node@v5
4734 with :
4835 node-version : 22
4936 - uses : ./.github/actions/cf-setup
5037 with :
51- cf-api : ${{ inputs.cf-api || vars.CF_API }}
52- cf-org : ${{ inputs.cf-org || vars.CF_ORG }}
53- cf-space : ${{ inputs.cf-space || vars.CF_SPACE }}
38+ cf-api : ${{ vars.CF_API }}
39+ cf-org : ${{ vars.CF_ORG }}
40+ cf-space : ${{ vars.CF_SPACE }}
5441 cf-username : ${{ vars.CF_USERNAME }}
5542 cf-password : ${{ secrets.CF_PASSWORD }}
5643 - run : npm clean-install
5744 - run : npx cds up
5845
59- - uses : ./.github/actions/cf-github-deploy
60- with :
61- app-name : ${{ env.APP_NAME }}
62- environment : ${{ inputs.environment || 'Staging' }}
63-
6446 - run : cf logs ${{ env.APP_NAME }} --recent
6547 if : always()
6648 - run : cf logs orders-srv --recent
7153 if : always()
7254 - run : cf logs ${{ env.APP_NAME }}-db-deployer --recent
7355 if : always()
56+
57+ - name : Get application URL
58+ id : route
59+ shell : bash
60+ run : |
61+ {{#literal}}host=$(cf app "${APP_NAME}" | awk '/routes:/ {print $2}' | sed -E 's#^https?://##; s/,.*$//')
62+ echo "url=https://$host" >> "$GITHUB_OUTPUT"{{/literal}}
63+ environment :
64+ name : ${{ inputs.environment || 'Staging' }}
65+ url : ${{ steps.route.outputs.url }}
0 commit comments