Skip to content

Migrate repository to match new Starter Kit structure (#481) #451

Migrate repository to match new Starter Kit structure (#481)

Migrate repository to match new Starter Kit structure (#481) #451

name: CI-CD - XM Cloud
on:
workflow_dispatch:
push:
branches: [ main ]
paths:
- .github/workflows/CI-CD_XM_Cloud.yml
- .github/workflows/deploy_xmCloud.yml
- .github/workflows/build_DotNet.yml
- 'xmcloud.build.json'
- 'authoring/**'
- 'headapps/Sugcon2024/**'
pull_request:
branches: [ main ]
paths:
- .github/workflows/CI-CD_XM_Cloud.yml
- .github/workflows/deploy_xmCloud.yml
- .github/workflows/build_DotNet.yml
- 'xmcloud.build.json'
- 'authoring/**'
- 'headapps/Sugcon2024/**'
jobs:
build-dotnet:
uses: ./.github/workflows/build_DotNet.yml
with:
buildConfiguration: Release
solution: authoring/platform/XMC-Introduction-Authoring.sln
deploy-staging:
uses: ./.github/workflows/deploy_xmCloud.yml
if: github.repository_owner == 'Sitecore' && ((github.event.pull_request.head.repo.full_name == github.repository) || (github.event_name == 'push'))
needs: build-dotnet
with:
environmentName: Staging
secrets:
XM_CLOUD_CLIENT_ID: ${{ secrets.XM_CLOUD_CLIENT_ID }}
XM_CLOUD_CLIENT_SECRET: ${{ secrets.XM_CLOUD_CLIENT_SECRET }}
XM_CLOUD_ENVIRONMENT_ID: ${{ secrets.STAGING_XM_CLOUD_ENVIRONMENT_ID }}
promote-to-prod:
if: github.ref == 'refs/heads/main'
needs: deploy-staging
uses: ./.github/workflows/promote_xmCloud.yml
with:
environmentName: Production
deploymentId: ${{ needs.deploy-staging.outputs.completedDeploymentId }}
secrets:
XM_CLOUD_CLIENT_ID: ${{ secrets.XM_CLOUD_CLIENT_ID }}
XM_CLOUD_CLIENT_SECRET: ${{ secrets.XM_CLOUD_CLIENT_SECRET }}
XM_CLOUD_ENVIRONMENT_ID: ${{ secrets.PRODUCTION_XM_CLOUD_ENVIRONMENT_ID }}