You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Added some documentation for `cds add github-actions` + how to set up a
sandbox subaccount the way we did for github.com/capire.
---------
Co-authored-by: Christian Georgi <chgeo@users.noreply.github.com>
Copy file name to clipboardExpand all lines: guides/deployment/cicd.md
+110-5Lines changed: 110 additions & 5 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,6 +16,116 @@ status: released
16
16
[[toc]]
17
17
18
18
19
+
20
+
21
+
## GitHub Actions
22
+
23
+
GitHub offers continuous integration using [GitHub Actions](https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration). In our [samples](https://github.com/capire/samples), we use simple workflows to [test, deploy and release new versions](https://github.com/capire/samples/tree/main/.github/workflows).
24
+
25
+
Add a default set of workflows to your project like so:
26
+
27
+
```sh
28
+
cds add github-actions
29
+
```
30
+
> You can also use `cds add gha` as a shortcut.
31
+
32
+
### Deploy to Staging
33
+
34
+
The created workflows do a _Staging_ deployment for pushes on the `main` branch, for example after merging pull requests.
35
+
36
+
If no defaults are maintained in your GitHub org, a set of variables and secrets has to be provided. Open the repository and navigate here to maintain them:
37
+
38
+
`Settings` → `Secrets and variables` → `Actions`
39
+
40
+
For a minimal deployment setup, these variables and secrets are required:
| Secret |`KUBE_CONFIG`| Base64-encoded Kubernetes config | see below |
57
+
58
+
59
+
::: details Example of a decoded `KUBE_CONFIG`
60
+
61
+
Your `KUBE_CONFIG` will have to look similar to this. Make sure to replace `token` by an authorization token created for your technical user used for deployment.
[Learn more about configuring Kubernetes](./to-kyma#configure-kubernetes){.learn-more style="margin-top:20px"}
84
+
85
+
:::
86
+
87
+
#### BTP Prerequisites
88
+
89
+
Also make sure sufficient service entitlements are assigned to your subaccount depending on your expected usage.
90
+
91
+
::: tip Set up a sandbox subaccount as an org-wide default
92
+
93
+
Organization variables and secrets allow you to provide defaults for new projects without prior setup.
94
+
95
+
Once required for your use case, you can easily **overwrite org-wide** variables and secrets by **repository-local** ones.
96
+
:::
97
+
98
+
#### You're set!
99
+
100
+
You can now simply push any CAP project that was set up using `cds add github-actions` to your org. When merging PRs or pushing to your `main` branch, the deployment workflow will start and after some time a new entry will show up in the _Deployments_ section on your repository front page:
For the actual release we want to override org-wide sandbox variables to deploy to a different subaccount/organization and database.
109
+
110
+
Go to `Settings` → `Environments` → `New environment` → enter "Production".
111
+
112
+
Now override org-wide variables (e.g. `CF_ORG` and `CF_SPACE` in Cloud Foundry) to use a dedicated subaccount you created for the release deployment.
113
+
114
+
#### Publish the release
115
+
116
+
On your repository front page go to `Releases` → `Draft a new release` → `Select tag`.
117
+
118
+
Now enter a tag name, e.g. `v1.0.0` and select `Create new tag: v1.0.0 on publish`.
119
+
120
+
You can optionally add a release title and release notes. Hit **Publish release** once you're ready.
121
+
122
+
The release will show up in your _Releases_ page and a deployment to your production environment is started. Once finished, a _Production_ entry shows up next to _Staging_:
@@ -35,8 +145,3 @@ For more flexibility you can set up continuous delivery in your software develop
35
145
Try the tutorial [Create Automated System Tests for SAP Cloud Application Programming Model Projects](https://developers.sap.com/tutorials/cicd-wdi5-cap.html) to create system tests against a CAP-based sample application and automate your tests through a CI/CD pipeline.
36
146
37
147
[See a comparison with SAP Continuous Integration and Delivery Service.](https://www.project-piper.io/){.learn-more}
38
-
39
-
## GitHub Actions
40
-
41
-
GitHub offers continuous integration workflows using [GitHub Actions](https://docs.github.com/en/actions/automating-builds-and-tests/about-continuous-integration). In our [SFlight sample,](https://github.com/SAP-samples/cap-sflight) we use GitHub Actions in two simple workflows to test our samples on [current Node.js and Java versions](https://github.com/SAP-samples/cap-sflight/tree/main/.github/workflows).
0 commit comments