From 7e88a8814fba50db8064009571f3db39072d615c Mon Sep 17 00:00:00 2001 From: Steffen Waldmann Date: Wed, 4 Feb 2026 13:51:10 +0100 Subject: [PATCH 1/3] Add GitHub Actions deployment --- .github/workflows/cf.yaml | 67 ++++++++++++++++++++++++++++++++++ .github/workflows/release.yaml | 22 +++++++++++ 2 files changed, 89 insertions(+) create mode 100644 .github/workflows/cf.yaml create mode 100644 .github/workflows/release.yaml diff --git a/.github/workflows/cf.yaml b/.github/workflows/cf.yaml new file mode 100644 index 0000000..8f462da --- /dev/null +++ b/.github/workflows/cf.yaml @@ -0,0 +1,67 @@ +name: Cloud Foundry + +on: + workflow_call: + inputs: + environment: + default: Staging + type: string + workflow_dispatch: + pull_request: + push: + branches: + - main + +permissions: + contents: read + deployments: write + packages: read + +concurrency: + group: cf-${{ github.workflow }}-${{ github.head_ref || github.run_id }} + cancel-in-progress: true + +env: + APP_NAME: xtravels + 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 + env: + NODE_AUTH_TOKEN: ${{secrets.GITHUB_TOKEN}} + + - 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 }} diff --git a/.github/workflows/release.yaml b/.github/workflows/release.yaml new file mode 100644 index 0000000..3206b81 --- /dev/null +++ b/.github/workflows/release.yaml @@ -0,0 +1,22 @@ +name: Release + +on: + workflow_dispatch: + release: + types: [published] + +permissions: + contents: read + deployments: write + packages: read + +jobs: + tests: + uses: capire/xflights-java/.github/workflows/maven.yaml@main + secrets: inherit + deploy-cf: + needs: [tests] + uses: capire/xflights-java/.github/workflows/cf.yaml@main + secrets: inherit + with: + environment: Production From f40a48eebb784c920e67467c42ba618556ef5209 Mon Sep 17 00:00:00 2001 From: Steffen Waldmann Date: Wed, 4 Feb 2026 13:57:13 +0100 Subject: [PATCH 2/3] Fix APP_NAME --- .github/workflows/cf.yaml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/cf.yaml b/.github/workflows/cf.yaml index 8f462da..d04231b 100644 --- a/.github/workflows/cf.yaml +++ b/.github/workflows/cf.yaml @@ -22,7 +22,7 @@ concurrency: cancel-in-progress: true env: - APP_NAME: xtravels + APP_NAME: xflights FORCE_COLOR: true jobs: deploy: From d87c9865ea5c448acee4b02d196e9431ddd95406 Mon Sep 17 00:00:00 2001 From: Steffen Waldmann Date: Wed, 4 Feb 2026 14:14:24 +0100 Subject: [PATCH 3/3] Update cf.yaml --- .github/workflows/cf.yaml | 1 - 1 file changed, 1 deletion(-) diff --git a/.github/workflows/cf.yaml b/.github/workflows/cf.yaml index d04231b..8e1cc25 100644 --- a/.github/workflows/cf.yaml +++ b/.github/workflows/cf.yaml @@ -7,7 +7,6 @@ on: default: Staging type: string workflow_dispatch: - pull_request: push: branches: - main