Skip to content

Commit 381d254

Browse files
authored
Deployment workflow simplifications (#31)
1 parent 6cc18a8 commit 381d254

File tree

3 files changed

+16
-80
lines changed

3 files changed

+16
-80
lines changed

.github/actions/cf-github-deploy/action.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

.github/workflows/cf.yaml

Lines changed: 16 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -3,21 +3,8 @@ name: Cloud Foundry
33
on:
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
@@ -71,3 +53,13 @@ jobs:
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 }}

.github/workflows/release.yaml

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,4 @@ jobs:
1919
uses: capire/samples/.github/workflows/cf.yaml@main
2020
secrets: inherit
2121
with:
22-
cf-api: ${{ vars.CF_API_PRODUCTION }}
23-
cf-org: ${{ vars.CF_ORG_PRODUCTION }}
24-
cf-space: ${{ vars.CF_SPACE_PRODUCTION }}
2522
environment: Production

0 commit comments

Comments
 (0)