Skip to content

SAP Commerce Cloud - Deploy

This GitHub Action provides the following functionalities to perform deployment operations on SAP Commerce Cloud in the Public Cloud (CCv2) projects.

Project Status

🚀 Completed Items

  • Trigger Deployment: Trigger SAP Commerce Cloud deployment.
  • Deployment Notification: Sends a notification when a deployment is triggered in CCv2.
  • Deployment Status Notification: Frequently check the deployment status and send notifications when success or failure.
  • Notifications: Notify the user via email or webhook when the build is triggered or completed.
    • Trigger Deployment: Triggered with deployment is created in CCv2.
    • Deployment Completed: Triggered when the deployment is completed in CCv2 whether it is success or failure.
    • Slack: Send notifications to Slack.
    • Microsoft Teams: Send notifications to Microsoft Teams.

🔧 Planned Items

  • Testing: Improve test coverage with end-to-end tests.
  • Notifications: Notify the user via email or webhook when the build is triggered or completed.
    • Deployment Progress: Check the deployment status and send notifications. (Is it required?)
    • Email: Send notifications to email.
    • SendGrid: Send notifications using SendGrid.
    • AWS SES: Send notifications using AWS SES.
    • Custom SMTP: Send notifications using custom SMTP.
    • Similar SMTP services.

Getting Started

Check this GitHub Action on the GitHub Marketplace

Example Workflow

Create a workflow YAML file (e.g., .github/workflows/deploy.yml) in your repository with the following content:

.github/workflows/deploy.yml
1
name: Deploy SAP Commerce Cloud
2
3
on:
4
push:
5
branches:
6
- main
7
- 'release/*'
8
pull_request:
9
branches:
10
- main
11
12
jobs:
13
deploy:
14
runs-on: ubuntu-latest
15
16
env:
17
SAP_CCV2_API_TOKEN: ${{ secrets.SAP_CCV2_API_TOKEN }}
18
SAP_CCV2_SUB_CODE: ${{ secrets.SAP_CCV2_SUB_CODE }}
19
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
20
21
steps:
22
- name: Checkout repository
23
uses: actions/checkout@v2
24
25
- name: SAP Commerce Deployment
26
id: deploy-action
27
uses: sap-cx-actions/commerce-deploy@v1
28
with:
29
buildCode: '20240910.1'
30
environmentCode: 'd1'
31
databaseUpdateMode: 'UPDATE'
32
deploymentMode: 'ROLLING_UPDATE'
33
notify: true
34
dryRun: false
35
36
- name: Print Output
37
id: output
38
run: |
39
echo "Deployment Code: ${{ steps.deploy-action.outputs.deploymentCode }}, Deployment Status: ${{ steps.deploy-action.outputs.deploymentStatus }}"

Environment Variables

VariablePurposeRequired
SAP_CCV2_API_TOKENSAP Commerce Cloud in the Public Cloud (CCv2) API Token.True
SAP_CCV2_SUB_CODESAP Commerce Cloud in the Public Cloud (CCv2) Subscription CodeTrue
WEBHOOK_URLThe Webhook URL to send notifications.False

Inputs

AttributePurposeRequiredDefaultExample
buildCodeThe build code to deploy, output from the @sap-cx-actions/commerce-build.True
environmentCodeThe environment code to deploy.Trued1, s1, p1
databaseUpdateModeThe database update mode.TrueNONE, UPDATE, INITIALIZE
deploymentModeThe deployment strategy.TrueROLLING_UPDATE, RECREATE, GREEN
notifySend notifications to the provided destination.Falsefalsetrue, false
dryRunRun the action in dry-run mode. If true, the action will not trigger the deployment in actual CCv2.Falsefalsefalse

Outputs

  • deploymentCode - The deployment code of the current deployment.
  • deploymentStatus - The status of the triggered deployment.