-
Notifications
You must be signed in to change notification settings - Fork 0
63 lines (56 loc) · 1.52 KB
/
cf.yaml
File metadata and controls
63 lines (56 loc) · 1.52 KB
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
name: Cloud Foundry
on:
workflow_call:
inputs:
environment:
default: Staging
type: string
workflow_dispatch:
push:
branches:
- main
permissions:
contents: read
deployments: write
concurrency:
group: cf-${{ github.workflow }}-${{ github.head_ref || github.run_id }}
cancel-in-progress: true
env:
APP_NAME: xflights
FORCE_COLOR: true
jobs:
deploy:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v6
- uses: actions/setup-node@v6
with:
node-version: 22
registry-url: https://npm.pkg.github.com/
- uses: actions/setup-java@v5
with:
distribution: sapmachine
java-version: 21
cache: maven
- uses: cap-js/cf-setup@v2
with:
api: ${{ vars.CF_API }}
org: ${{ vars.CF_ORG }}
space: ${{ vars.CF_SPACE }}
username: ${{ vars.CF_USERNAME }}
password: ${{ secrets.CF_PASSWORD }}
- run: npm install
- run: npx cds up
- run: cf logs "${{ env.APP_NAME }}-srv" --recent
if: always()
- run: cf logs "${{ env.APP_NAME }}-db-deployer" --recent
if: always()
- name: Get backend URL
id: route
shell: bash
run: |
host=$(cf app "${APP_NAME}-srv" | awk '/routes:/ {print $2}' | sed -E 's#^https?://##; s/,.*$//')
echo "url=https://$host" >> "$GITHUB_OUTPUT"
environment:
name: ${{ inputs.environment || 'Staging' }}
url: ${{ steps.route.outputs.url }}