-
Notifications
You must be signed in to change notification settings - Fork 140
105 lines (99 loc) · 2.95 KB
/
deploy-btp.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
on:
workflow_call:
inputs:
btp-subdomain:
type: string
required: false
default: 284dfa06-4fb6-445e-809c-263b132a0840
btp-subaccount-id:
type: string
required: false
default: 1e4c6bcd-71c5-42c6-88ab-636e3a6dc12e
btp-cli-url:
type: string
required: false
default: https://cpcli.cf.sap.hana.ondemand.com
cf-api:
type: string
required: false
default: 'https://api.cf.eu12.hana.ondemand.com'
cf-org:
type: string
required: false
default: cap-sflight
cf-space:
type: string
required: true
role-collection:
type: string
required: true
mta-source-dir:
description: relative path to dir with mta.yaml
type: string
required: false
default: '.'
mtar-dir:
description: path to dir with mtar
type: string
required: false
default: gen
mtar-file:
description: file name of mtar
type: string
required: false
default: sflight.mtar
secrets:
username:
required: true
password:
required: true
grant-users:
description: List of users to assign the role role-collection to
required: false
outputs:
ui_app_url:
value: ${{ jobs.deployment.outputs.ui_app_url }}
jobs:
deployment:
name: To BTP
runs-on: ubuntu-latest
environment:
name: staging
url: ${{ steps.deploy.outputs.url }}
concurrency: staging
env:
CF_API: ${{ inputs.cf-api }}
CF_ORG: ${{ inputs.cf-org }}
CF_SPACE: ${{ inputs.cf-space }}
CF_USERNAME: ${{ secrets.username }}
CF_PASSWORD: ${{ secrets.password }}
GRANT_USERS: ${{ secrets.grant-users }}
outputs:
ui_app_url: ${{ steps.deploy.outputs.url }}
steps:
- uses: actions/checkout@v4
- uses: actions/setup-node@v4
with:
node-version: 16
- uses: actions/cache@v4
id: cache
with:
path: ${{ inputs.mtar-dir }}/${{ inputs.mtar-file }}
key: ${{ runner.os }}-${{ github.head_ref || github.ref_name }}-${{ hashFiles('_i18n/**','app/**','db/**','srv/**','*.json','**/mta.yaml','pom.xml') }}
- name: MTA build
if: steps.cache.outputs.cache-hit != 'true'
run: npx mbt build -s ${{ inputs.mta-source-dir }} -t ${{ inputs.mtar-dir }} --mtar ${{ inputs.mtar-file }}
- name: CF Deploy
id: deploy
uses: ./.github/actions/cf-deploy
with:
createspace: true
mtafile: ${{ inputs.mtar-dir }}/${{ inputs.mtar-file }}
findurl_command: 'cf html5-list -di sflight-destination-service -u'
- name: Assign Roles
uses: ./.github/actions/btp
with:
cli_url: ${{ inputs.btp-cli-url }}
subdomain: ${{ inputs.btp-subdomain }}
subaccount_id: ${{ inputs.btp-subaccount-id }}
role_collection: ${{ inputs.role-collection }}