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
name: Deploy SAP Commerce Cloud
on:
push:
branches:
- main
- 'release/*'
pull_request:
branches:
- main
jobs:
deploy:
runs-on: ubuntu-latest
env:
SAP_CCV2_API_TOKEN: ${{ secrets.SAP_CCV2_API_TOKEN }}
SAP_CCV2_SUB_CODE: ${{ secrets.SAP_CCV2_SUB_CODE }}
WEBHOOK_URL: ${{ secrets.WEBHOOK_URL }}
steps:
- name: Checkout repository
uses: actions/checkout@v2
- name: SAP Commerce Deployment
id: deploy-action
uses: sap-cx-actions/commerce-deploy@v1
with:
buildCode: '20240910.1'
environmentCode: 'd1'
databaseUpdateMode: 'UPDATE'
deploymentMode: 'ROLLING_UPDATE'
notify: true
dryRun: false
timezone: America/New_York
- name: Print Output
id: output
run: |
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
timezoneThe timezone to use for the timestamps.FalseAmerica/New_York

Outputs

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