-
Notifications
You must be signed in to change notification settings - Fork 0
cds add github-actions
#29
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Changes from all commits
Commits
Show all changes
19 commits
Select commit
Hold shift + click to select a range
9f00df1
`cds add github-actions`
swaldmann 3e7290d
Add pull_request trigger to cf.yaml workflow
swaldmann aa492fc
Add `packages` permission
swaldmann 4c39450
Merge branch 'gha' of https://github.com/capire/xtravels-java into gha
swaldmann 305e1bb
Add NODE_AUTH_TOKEN
swaldmann 006a4ab
Update .npmrc
swaldmann c3addcd
Set `FORCE_COLOR`
swaldmann 76f3b3a
Merge branch 'main' into gha
swaldmann c38daa0
Upgrade GitHub Actions to latest versions
swaldmann f703731
Upgrade GitHub Actions to latest versions
swaldmann 84bf329
Merge remote-tracking branch 'origin/main' into gha
swaldmann 94e7382
temp rm mock users
swaldmann 5f6dce6
Update application.yaml
swaldmann 1024a36
Update application.yaml
swaldmann 6397550
Restore admin roles in security configuration
swaldmann 229f8be
Use `registry-url` in Workflow
swaldmann 1e51d35
Remove test workflow in favor of maven one
swaldmann b09d83a
Update cf.yaml
swaldmann 86d716d
Remove pull_request trigger from cf.yaml
swaldmann File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,69 @@ | ||
| name: Cloud Foundry | ||
|
|
||
| on: | ||
| workflow_call: | ||
| inputs: | ||
| environment: | ||
| default: Staging | ||
| type: string | ||
| workflow_dispatch: | ||
| 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 | ||
| NODE_AUTH_TOKEN: ${{ secrets.GITHUB_TOKEN }} | ||
| 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 }}" --recent | ||
| if: always() | ||
| - run: cf logs "${{ env.APP_NAME }}-srv" --recent | ||
| if: always() | ||
| - run: cf logs "${{ env.APP_NAME }}-db-deployer" --recent | ||
| if: always() | ||
|
|
||
| - name: Get application URL | ||
| id: route | ||
| shell: bash | ||
| run: | | ||
| host=$(cf app "${APP_NAME}" | 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 }} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| name: Release | ||
|
|
||
| on: | ||
| workflow_dispatch: | ||
| release: | ||
| types: [published] | ||
|
|
||
| permissions: | ||
| contents: read | ||
| deployments: write | ||
| packages: read | ||
|
|
||
| jobs: | ||
| tests: | ||
| uses: capire/xtravels-java/.github/workflows/maven.yaml@main | ||
| secrets: inherit | ||
| deploy-cf: | ||
| needs: [tests] | ||
| uses: capire/xtravels-java/.github/workflows/cf.yaml@main | ||
| secrets: inherit | ||
| with: | ||
| environment: Production |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
AMS requires us to disable mock users in the cloud… otherwise you get cryptic errors on Java server startup:
https://github.com/capire/xtravels-java/actions/runs/21216937849/job/61040618351#step:9:969
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for finding that. AFAIK that's actually a known issue. @BraunMatthias Isn't this fixed yet?