File tree Expand file tree Collapse file tree 3 files changed +49
-4
lines changed
Expand file tree Collapse file tree 3 files changed +49
-4
lines changed Original file line number Diff line number Diff line change 55 app-name :
66 description : " Base name of the deployed CAP app"
77 required : true
8+ environment :
9+ description : " Deployment environment name"
10+ required : true
811
912runs :
1013 using : " composite"
@@ -21,18 +24,20 @@ runs:
2124 uses : actions/github-script@v7
2225 env :
2326 URL : ${{ steps.get-url.outputs.url }}
27+ ENVIRONMENT : ${{ inputs.environment }}
2428 with :
2529 script : |
2630 const { owner, repo } = context.repo
2731 const ref = context.ref
2832 const url = process.env.URL
33+ const environment = process.env.ENVIRONMENT
2934
3035 const deployment = await github.rest.repos.createDeployment({
3136 owner,
3237 repo,
3338 ref,
3439 required_contexts: [],
35- environment: 'Staging' ,
40+ environment,
3641 auto_merge: false,
3742 description: 'Deployed to Cloud Foundry',
3843 })
Original file line number Diff line number Diff line change @@ -2,6 +2,24 @@ name: Cloud Foundry
22
33on :
44 workflow_call :
5+ inputs :
6+ cf-api :
7+ description : ' Cloud Foundry API endpoint'
8+ required : true
9+ type : string
10+ cf-org :
11+ description : ' Cloud Foundry organization'
12+ required : true
13+ type : string
14+ cf-space :
15+ description : ' Cloud Foundry space'
16+ required : true
17+ type : string
18+ environment :
19+ description : ' Deployment environment name'
20+ required : true
21+ type : string
22+
523 workflow_dispatch :
624 merge_group :
725 push :
2745 node-version : 22
2846 - uses : ./.github/actions/cf-setup
2947 with :
30- cf-api : ${{ vars.CF_API }}
31- cf-org : ${{ vars.CF_ORG }}
32- cf-space : ${{ vars.CF_SPACE }}
48+ cf-api : ${{ inputs.cf-api || vars.CF_API }}
49+ cf-org : ${{ inputs.cf-org || vars.CF_ORG }}
50+ cf-space : ${{ inputs.cf-space || vars.CF_SPACE }}
3351 cf-username : ${{ vars.CF_USERNAME }}
3452 cf-password : ${{ secrets.CF_PASSWORD }}
3553 - run : npm clean-install
3856 - uses : ./.github/actions/cf-github-deploy
3957 with :
4058 app-name : ${{ env.APP_NAME }}
59+ environment : ${{ inputs.environment || 'Staging' }}
4160
4261 - run : cf logs ${{ env.APP_NAME }} --recent
4362 - run : cf logs orders-srv --recent
Original file line number Diff line number Diff line change 1+ name : Release
2+
3+ on :
4+ workflow_dispatch :
5+ release :
6+ types : [published]
7+
8+ jobs :
9+ tests :
10+ uses : cap-sandbox/samples/.github/workflows/test.yaml@main
11+ secrets : inherit
12+
13+ deploy-cf :
14+ needs : [tests]
15+ uses : cap-sandbox/samples/.github/workflows/cf.yaml@main
16+ secrets : inherit
17+ with :
18+ cf-api : ${{ vars.CF_API_PRODUCTION }}
19+ cf-org : ${{ vars.CF_ORG_PRODUCTION }}
20+ cf-space : ${{ vars.CF_SPACE_PRODUCTION }}
21+ environment : Production
You can’t perform that action at this time.
0 commit comments