@@ -3,28 +3,19 @@ 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 :
2411 push :
2512 branches :
2613 - main
2714
15+ permissions :
16+ contents : read
17+ deployments : write
18+
2819concurrency :
2920 group : cf-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
3021 cancel-in-progress : true
@@ -36,27 +27,22 @@ jobs:
3627 deploy :
3728 runs-on : ubuntu-latest
3829 steps :
39- - uses : actions/checkout@v4
30+ - uses : actions/checkout@v5
4031 with :
4132 submodules : true
42- - uses : actions/setup-node@v4
33+ - uses : actions/setup-node@v5
4334 with :
4435 node-version : 22
4536 - uses : ./.github/actions/cf-setup
4637 with :
47- cf-api : ${{ inputs.cf-api || vars.CF_API }}
48- cf-org : ${{ inputs.cf-org || vars.CF_ORG }}
49- 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 }}
5041 cf-username : ${{ vars.CF_USERNAME }}
5142 cf-password : ${{ secrets.CF_PASSWORD }}
5243 - run : npm clean-install
5344 - run : npx cds up
5445
55- - uses : ./.github/actions/cf-github-deploy
56- with :
57- app-name : ${{ env.APP_NAME }}
58- environment : ${{ inputs.environment || 'Staging' }}
59-
6046 - run : cf logs ${{ env.APP_NAME }} --recent
6147 if : always()
6248 - run : cf logs orders-srv --recent
6753 if : always()
6854 - run : cf logs ${{ env.APP_NAME }}-db-deployer --recent
6955 if : always()
56+
57+ - name : Get application URL
58+ id : route
59+ shell : bash
60+ run : |
61+ host=$(cf app "${APP_NAME}" | awk '/routes:/ {print $2}' | sed -E 's#^https?://##; s/,.*$//')
62+ echo "url=https://$host" >> "$GITHUB_OUTPUT"
63+ environment :
64+ name : ${{ inputs.environment || 'Staging' }}
65+ url : ${{ steps.route.outputs.url }}
0 commit comments